![]() |
• World Manager | ||||||||||||||||||||||||||||||
|
API Links
Developer Links
|
World::QueryWorldDefined in:
Detects whether a swept sphere intersects world geometry or rigid bodies.
C4World.hPrototype
Parameters
Description
The points specified by the parameters p1 and p2, combined with the radius specified by the radius parameter, define a directed swept sphere. The QueryWorld function detects the first collision between this swept sphere and all Geometry nodes possessing collision information. Unlike the World::DetectCollision function, the QueryWorld function also detects collisions with any RigidBodyController objects. If a collision is detected, then the function returns either kCollisionStateGeometry or kCollisionStateRigidBody, depending on the type of collision; otherwise, it returns kCollisionStateNone.The clas parameter can be used to invalidate certain types of collisions. When a candidate geometry or rigid body is encountered in the collision detection process, its collision exclusion mask is logically ANDed with the value of the clas parameter. A collision can only occur if the result of this operation is zero. The collision mask associated with a geometry can be set using the GeometryObject::SetCollisionExclusionMask function, and the collision mask for a rigid body can be set using the RigidBodyController::SetCollisionExclusionMask function. The collision class can be a combination (through logical OR) of the following predefined values and application-defined values.
CollisionData structure pointed to by the data parameter is filled out with information about the collision. The param field of this data structure represents the fraction of the distance that the sphere traveled from p1 to p2 before the collision occurred.
See Also
|