Module vrCollision :: Class vrCollision
[frames] | no frames]

Class vrCollision

   object --+        
            |        
  ??.instance --+    
                |    
vrAEBase.vrAEBase --+
                    |
                   vrCollision

Collision detection.

Example:

       See also example collision.py
Instance Methods
 
__init__(nodesa, nodesb)
The constructor of the vrCollision class.
tuple of vrNodePtr
getCollidingNodes()
Retrieve the pair of nodes that collided.
tuple of int
getCollidingTriangleIndices()
Retrieve the pair of triangle indices that collided.
tuple of Pnt3f
getCollidingTriangles(useWorldSpace)
Retrieve the pair of triangle vertices that collided.
tuple of Pnt3f, vrNodePtr, Vec3f, vrNodePtr, Vec3f
getCollisionInfo(useWorldSpace)
Retrieves information about the collision.
Pnt3f
getCollisionPoint(useWorldSpace)
Retrieves the detected collision point.
bool
isColliding()
Checks if objects from the two lists are colliding.

Inherited from vrAEBase.vrAEBase: __reduce__, addLoop, callAllConnected, connect, connectSignal, emitSignal, getModuleName, isActive, loop, recEvent, removeConnections, setActive, setUpdateGUIEnabled, subLoop

Inherited from unreachable.instance: __new__

Class Variables
  __instance_size__ = 184
Method Details

__init__(nodesa, nodesb)
(Constructor)

 

The constructor of the vrCollision class.

Parameters:
  • nodesa (list of vrNodePtrs) - The first list of nodes.
  • nodesb (list of vrNodePtrs) - The second list of nodes.
Overrides: vrAEBase.vrAEBase.__init__

getCollidingNodes()

 

Retrieve the pair of nodes that collided.

Only valid after a call to isColliding() that returned true.

Returns: tuple of vrNodePtr
tuple of two nodes

getCollidingTriangleIndices()

 

Retrieve the pair of triangle indices that collided.

Only valid after a call to isColliding() that returned true.

Returns: tuple of int
tuple of two indices

getCollidingTriangles(useWorldSpace)

 

Retrieve the pair of triangle vertices that collided.

Only valid after a call to isColliding() that returned true.

Parameters:
  • useWorldSpace (bool) - Specifices whether the returned positions should be in world space or object space.
Returns: tuple of Pnt3f
tuple of 6 Pnt3f representing the two colliding triangles

getCollisionInfo(useWorldSpace)

 

Retrieves information about the collision.

Only valid after a call to isColliding() that returned true.

The function returns the collision position, the node and the normal of the first object involved in the collision and the node and the normal of the second object involved in the collision.

Parameters:
  • useWorldSpace (bool) - Specifices whether the returned positions and normals should be in world space or object space.
Returns: tuple of Pnt3f, vrNodePtr, Vec3f, vrNodePtr, Vec3f
tuple of collision point, first collision object, first collision object normal, second collision object, second collision normal

getCollisionPoint(useWorldSpace)

 

Retrieves the detected collision point.

Only valid after a call to isColliding() that returned true.

Parameters:
  • useWorldSpace (bool) - Specifices whether the returned positions should be in world space or object space.
Returns: Pnt3f
Returns the position of the collision.

isColliding()

 

Checks if objects from the two lists are colliding.

Returns: bool
Returns true if a collision is detected, false otherwise.