Polyline in JPCT-AE is unable for using by standart methods. But, by Ricardossy1, in his post: Ricardossy1 post, was described way for solving problem.
I was needed for Polylines in my project and jpst-ae wrapper and xml-file was edited in Eclipse from alhowiriny's sources.
Was added some next methods to Polyline Class of wrapper:
Sub Clobals
Sub JPCT_SurfaceChanged
Polyline will be enable only with last version of JPCT-AE library! (23/03/2021)
I was needed for Polylines in my project and jpst-ae wrapper and xml-file was edited in Eclipse from alhowiriny's sources.
Was added some next methods to Polyline Class of wrapper:
- Essai - creating array of JSimpleVector
- setTransparencyMode - by default=0 (invisible)
- setWidth - change Width of line
- setColor - change Color of Polyline
- setParent - for linking Polyline to some Object3D in World
Sub Clobals
B4X:
Dim Pl_Line As JpctPolyline
Dim Pl_obj() As Object
Dim Pl_point(3) As JpctSimpleVector
Sub JPCT_SurfaceChanged
B4X:
Dim i As Int
Dim LineColor As JpctRGBColor
LineColor.Initialize2(50,100,250)
Pl_obj=Pl_Line.essai(Pl_point.Length) 'Create Array of JSimpleVector
'Filling array of Vectors (Points)
Pl_point(0).Initialize2(0,125,0)
Pl_obj(0)=Pl_point(0)
Pl_point(1).Initialize2(0,0,0)
Pl_obj(1)=Pl_point(1)
Pl_point(2).Initialize2(125,0,0)
Pl_obj(2)=Pl_point(2)
Pl_Line.Initialize(Pl_obj,LineColor) 'Initializing Polyline
Pl_Line.setColor(LineColor) 'SetColor for Polylines
Pl_Line.setPercentage(1) 'Show 100% of Polylines Long
Pl_Line.setVisible(True) 'Set Polyline visible'
Pl_Line.setWidth(3) 'Set Width of polyline=3
Pl_Line.setTransparencyMode(-1) 'Not Transparent Polyline
World.addPolyline(Pl_Line) 'Add Polyline to World
Pl_Line.setParent(curBody) 'Link Polyline to some Object3D
'Logs for controlling Points-Data in Polyline
Log(Pl_Line.Length)
For i=0 To 2
Log(i)
Log("x=" & Pl_point(i).x)
Log("y=" & Pl_point(i).y)
Log("z=" & Pl_point(i).z)
Log("obj(" & i & ")=" & Pl_obj(i))
Next 'i
Polyline will be enable only with last version of JPCT-AE library! (23/03/2021)
Attachments
Last edited: