QRaycast objects send a ray into the world and return collision results with body objects. You can create a constant raycast object that you can add to the world and update collision results at every physics step, or you can make instantaneous raycast calls at runtime using the QRaycast::RaycastTo static method. QWorld also provides methods for managing QRaycast objects.
More...
#include <qraycast.h>
|
int | collidableLayersBit =1 |
|
QRaycast objects send a ray into the world and return collision results with body objects. You can create a constant raycast object that you can add to the world and update collision results at every physics step, or you can make instantaneous raycast calls at runtime using the QRaycast::RaycastTo static method. QWorld also provides methods for managing QRaycast objects.
◆ QRaycast()
QRaycast::QRaycast |
( |
QVector |
position, |
|
|
QVector |
rayVector, |
|
|
bool |
enableContainingBodies = false |
|
) |
| |
Creates a raycast.
- Parameters
-
position | The position of the raycast. |
rayVector | The ray vector. |
enableContainingBodies | Determines whether a body should be ignored in raycast collisions if the ray position is inside the shape representing the body in the world. If set to true, these objects will be ignored in raycast collisions. |
◆ GetCollidableLayersBit()
int QRaycast::GetCollidableLayersBit |
( |
| ) |
|
Returns the bit mask that represents the layers in which the body object is present.
◆ GetContacts()
Returns contact list of the raycast.
◆ GetEnabledContainingBodies()
bool QRaycast::GetEnabledContainingBodies |
( |
| ) |
|
Returns whether a body should be ignored in raycast collisions if the ray position is inside the shape representing the body in the world. If set to true, these objects will be ignored in raycast collisions.
◆ GetPosition()
Returns the position of the raycast.
◆ GetRayVector()
Returns the ray vector of the raycast.
◆ GetRotation()
float QRaycast::GetRotation |
( |
| ) |
|
Returns the rotation of the raycast.
◆ RaycastTo()
Sends a ray into the world with the given position and direction vector. Returns a collection of QRaycast::Contact containing collision information with body objects hit by the ray.
- Parameters
-
world | The world. |
rayPosition | The position of the ray. |
rayVector | The vector of the ray. |
collidableLayers | The target layer bits.
|
enableContainingBodies | Determines whether a body should be ignored in raycast collisions if the ray position is inside the shape representing the body in the world. If set to true, these objects will be ignored in raycast collisions. |
- Returns
- A collection of contacts as a result of the raycast operation.
◆ SetCollidableLayersBit()
QRaycast * QRaycast::SetCollidableLayersBit |
( |
int |
value | ) |
|
Sets the bit mask that represents the collidable layers in which the body object is present.A raycast object can collide with other body objects present in the layers defined by the user.
- Parameters
-
value | A bit mask value to set.
|
◆ SetEnabledContainingBodies()
QRaycast * QRaycast::SetEnabledContainingBodies |
( |
bool |
value | ) |
|
Sets whether a body should be ignored in raycast collisions if the ray position is inside the shape representing the body in the world. If set to true, these objects will be ignored in raycast collisions.
- Parameters
-
◆ SetPosition()
Sets the position of the raycast
- Parameters
-
◆ SetRayVector()
Sets the ray vector of the raycast
- Parameters
-
value | A ray vector to set. |
◆ SetRotation()
QRaycast * QRaycast::SetRotation |
( |
float |
value | ) |
|
Sets the rotation of the raycast
- Parameters
-
The documentation for this class was generated from the following files: