Tao.Ode SDK Documentation |
|
Ode.dBoxBox Method
given two boxes (p1,R1,side1) and (p2,R2,side2), collide them together and generate contact points. this returns 0 if there is no contact otherwise it returns the number of contacts generated. `normal' returns the contact normal. `depth' returns the maximum penetration depth along that normal. `return_code' returns a number indicating the type of contact that was detected: 1,2,3 = box 2 intersects with a face of box 1 4,5,6 = box 1 intersects with a face of box 2 7..15 = edge-edge contact `maxc' is the maximum number of contacts allowed to be generated, i.e. the size of the `contact' array. `contact' and `skip' are the contact array information provided to the collision functions. this function only fills in the position and depth fields.
[Visual Basic]
Public Shared Function dBoxBox( _
ByVal
p1 As
dVector3, _
ByVal
R1 As
dMatrix3, _
ByVal
side1 As
dVector3, _
ByVal
p2 As
dVector3, _
ByVal
R2 As
dMatrix3, _
ByVal
side2 As
dVector3, _
ByRef
normal As
dVector3, _
ByRef
depth As
Single, _
ByRef
return_code As
Integer, _
ByVal
maxc As
Integer, _
ByRef
contact As
dContactGeom(), _
ByVal
skip As
Integer _
) As
Integer
[C#]
public static
int dBoxBox(
dVector3 p1,
dMatrix3 R1,
dVector3 side1,
dVector3 p2,
dMatrix3 R2,
dVector3 side2,
ref
dVector3 normal,
ref
float depth,
ref
int return_code,
int maxc,
ref
dContactGeom[] contact,
int skip);
Parameters
-
p1
- A dVector3 containing the center coordinates for box 1
-
R1
- A dMatrix3 containing the rotation matrix for box 1
-
side1
- A dVector3 containing the side lengths (x/y/z) for box 1
-
p2
- A dVector3 containing the center coordinates for box 2
-
R2
- A dMatrix3 containing the rotation matrix for box 2
-
side2
- A dVector3 containing the side lengths (x/y/z) for box 1
-
normal
- returns the value of the contact normal
-
depth
- returns the maximum penetration along the contact normal
-
return_code
- returns the type of contact detected
-
maxc
- specifies the maximum number of contacts allowed (should match size of contact array)
-
contact
- an array of ContactGeoms returning the contact information
-
skip
- contact array information provided to collision functions. Size of contact geom?
Return Value
the number of contacts generated
See Also
Ode Class | Tao.Ode Namespace