GetPhysicsCollisionFlags

Definition

bool GetPhysicsCollisionFlags(string group1, string group2)

Description

Each physics actor in Vanda engine belongs to a specific group. For example, a dynamic physics actor belongs to the “DYNAMIC” group, while a static physics actor belongs to the “STATIC” group. This function returns true if collision detection between the given pair of groups is enabled at runtime, otherwise it returns false.
You can use the Tools > Current VScene Properties menu or SetPhysicsCollisionFlags function to enable/disable collision detection between physics actors belonging to a given pair of groups. Initially all pair of physics groups except (Trigger vs. Ground Plane) pair are enabled, meaning that collision detection happens between all physics actors except (Trigger vs. Ground Plane).

Parameters

group1
Specifies the first group. The following group types are supported:

“KINEMATIC”
Kinematic is a dynamic actor that can ignore some rules of physics, and its rotation and translation is controlled by prefab instance.

“DYNAMIC”
A dynamic actor has its position and rotation updated by the physics simulation and controls the translation and rotation of its prefab instance.

“TRIGGER”
Triggers allow colliders to perform overlap tests.

“STATIC”
Static actor is immovable by the physics simulation.

“GROUND”
Default physics ground plane.

group2
Specifies the second group. The supported groups are similar to the group1 description.

Return Value

Return values are true or false. The true value means that collision detection between two physics actors a and b belonging to group1 and group2 occurs.

Example

flag = false
message = ""

function Init()
    flag  = GetPhysicsCollisionFlags("DYNAMIC""KINEMATIC")

    if flag == true then
          message = string.format("\nCollision detection between dynamic and kinematic actors is 'true'")
    else
          message = string.format("\nCollision detection between dynamic and kinematic actors is 'false'")
    end

    PrintConsole(message)
end

function Update()

end
In this example, if the collision detection between dynamic and kinematic physics actors is enabled, GetPhysicsCollisionFlags returns true, otherwise it returns false. Then we print the result in the console using the PrintConsole function.
adminGetPhysicsCollisionFlags