Package org.robwork.sdurw_geometry
Class OBBPtr
- java.lang.Object
-
- org.robwork.sdurw_geometry.OBBPtr
-
public class OBBPtr extends java.lang.ObjectPtr stores a pointer and optionally takes ownership of the value.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OBB__ref__()Dereferencing operator.OBBbuildTightOBB(TriMesh tris)OBBbuildTightOBB(TriMesh tris, long index)doublecalcArea()calculates the total area of the boxdoublecalcVolume()calculate the volume of this OBBOBBCPtrcptr()TriMeshPtrcreateMesh()Creates a TriMesh representing the OBB.
The triangles of the mesh is by default placed in the "global" frame corresponding to the
frame in which the OBB is defined.TriMeshPtrcreateMesh(boolean local)Creates a TriMesh representing the OBB.
The triangles of the mesh is by default placed in the "global" frame corresponding to the
frame in which the OBB is defined.voiddelete()OBBderef()The pointer stored in the object.booleanequals(OBB p)static longgetCPtr(OBBPtr obj)OBBgetDeref()Member access operator.Vector3DgetHalfLengths()get the halflengths of this OBBTransform3DgetTransform()booleanisNull()checks if the pointer is nullbooleanisShared()check if this Ptr has shared ownership or none
ownershipvoidsetHalfLengths(Vector3D halfLng)set the halflengths of the OBBvoidsetTransform(Transform3D t3d)set the transformation of this OBBjava.lang.StringtoString()
-
-
-
Constructor Detail
-
OBBPtr
public OBBPtr(long cPtr, boolean cMemoryOwn)
-
OBBPtr
public OBBPtr()
Default constructor yielding a NULL-pointer.
-
OBBPtr
public OBBPtr(OBB ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(OBBPtr obj)
-
delete
public void delete()
-
deref
public OBB deref()
The pointer stored in the object.
-
__ref__
public OBB __ref__()
Dereferencing operator.
-
getDeref
public OBB getDeref()
Member access operator.
-
equals
public boolean equals(OBB p)
-
isShared
public boolean isShared()
check if this Ptr has shared ownership or none
ownership- Returns:
- true if Ptr has shared ownership, false if it has no ownership.
-
isNull
public boolean isNull()
checks if the pointer is null- Returns:
- Returns true if the pointer is null
-
cptr
public OBBCPtr cptr()
-
getTransform
public Transform3D getTransform()
-
setTransform
public void setTransform(Transform3D t3d)
set the transformation of this OBB
-
getHalfLengths
public Vector3D getHalfLengths()
get the halflengths of this OBB
-
setHalfLengths
public void setHalfLengths(Vector3D halfLng)
set the halflengths of the OBB
-
calcVolume
public double calcVolume()
calculate the volume of this OBB
-
calcArea
public double calcArea()
calculates the total area of the box
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
createMesh
public TriMeshPtr createMesh(boolean local)
Creates a TriMesh representing the OBB.
The triangles of the mesh is by default placed in the "global" frame corresponding to the
frame in which the OBB is defined. In case the parameter local is set to true, the
reference frame will be the frame of the OBB itself.
-
createMesh
public TriMeshPtr createMesh()
Creates a TriMesh representing the OBB.
The triangles of the mesh is by default placed in the "global" frame corresponding to the
frame in which the OBB is defined. In case the parameter local is set to true, the
reference frame will be the frame of the OBB itself.
-
-