vrdCameraCollider

class vrdCameraCollider

(Inherits vrdSceneObject)

This class provides access to the camera collision configuration.

An instance of this class modifies only the parameters of the camera it belongs to. After changing any property or adding / removing a node vrdCameraCollider.buildCollisionStructure() must always be called to update the collision structures with the changed parameters.

Functions

vrdCameraCollider.addNode(nodeName)

Add a not to collide with the camera.

Parameters:nodeName (string) – The name of the node. If it’s not unique, the first node found with this name will be used.
vrdCameraCollider.buildCollisionStructure()

Starts the precalculation of the collision structures.

To use this feature, precalculation that adopts the collision settings is required. Any change made using this API requires recalculating the scene again.

vrdCameraCollider.getCollisionStructureBuildMethod()

Returns the collision structure build method.

Returns:The collision structure build method (triangle or bounding box).
Return type:vrCameraTypes.CollisionStructureBuildMethod
vrdCameraCollider.getDistance()

Returns the closest allowed distance from the camera to a colliding object.

Returns:The collision detection distance (mm).
Return type:float
vrdCameraCollider.getEnabled()

Returns if camera collisions are enabled.

Returns:True if collisions are enabled, False if disabled.
Return type:bool
vrdCameraCollider.getNodes()

Returns the list of node names that can collide with the camera.

Returns:The list of node names.
Return type:List[string]
vrdCameraCollider.getSlide()

Returns if the slide mode is activated.

Returns:True if activated, False otherwise.
Return type:bool
vrdCameraCollider.removeNode(nodeName)

Remove a node from the camera collision detection.

Parameters:nodeName (string) – The name of the node.
vrdCameraCollider.setCollisionStructureBuildMethod(method)

Sets the collision structure build method.

This is the selection of the algorithm that is used for collision detection. It can either be triangle or bounding box based.

Parameters:method (vrCameraTypes.CollisionStructureBuildMethod) – The collision structure build method.
vrdCameraCollider.setDistance(distance)

Sets the closest allowed distance from the camera to a colliding object.

This defines the distance between the camera and an object in mm, when the camera detects a collision.

Parameters:distance (float) – The collision detection distance (mm).
vrdCameraCollider.setEnabled(enabled)

Enable / disable camera collisions.

Activate collision detection to avoid flying through objects with the camera.

Parameters:enabled (bool) – True to enable, False to disable camera collisions.
vrdCameraCollider.setNodes(nodeNames)

Add nodes allowed to collide with the camera.

This adds a list of node names which will be able to collide with the camera.

Parameters:nodeNames (List[string]) – The list of node names. If a name is not unique, the first node found with the name will be used.
vrdCameraCollider.setSlide(enabled)

Enable / disable the slide mode.

This enables the camera to slide over the surface when a collision occurs.

Parameters:enabled (bool) – True to enable sliding, False to disable.