PhysicsAPI¶
Beta
PhysicsAPI is an interface which defines properties, events, and functions for objects which simulates physics.Functions¶
Fired when the entity has been hit.
Fired when the character enters a trigger.
Fired when the character exit a trigger.
Fired when the character enters another character or rigidbody.
Fired when the character exits another character or rigidbody.
Applies a force to the rigidbody.
entityIndicates the rigidbody to applied a force.forceforce
Applies an impulse to the rigidbody.
entityThe rigidbody to applies an impulse.forceforce
Applies a torque to the rigidbody.
entityThe rigidbody to apply a torque.torqueTorque
Applies a force at the specified position.
Applies a force at the specified local position.
Applies a local force at the specified local position.
void PhysicsAPI.AddExplosionImpulseForce(YaEntity entity, number explosionForce, float3 explosionPosition, number radius, number upwardsModifier)Beta
Applies an explosion at the specified position.
Sets the angular velocity.
angVelangle velocity
Sets the linear velocity.
linVellinear velocity
Gets the angular velocity.
Gets the linear velocity.
void PhysicsAPI.ResetPositionAndRotation(YaEntity entity, float3 pos, quaternion rotate, boolean clearVelocity)Beta
Resets the position and rotation of the entity.
clearVelocityIgnore physics velocity on entity
Enables collisions on the entity.
Checks if the entity is in the Trigger box.
YaQueryResult PhysicsAPI.RaycastSingle(float3 origin, float3 direction, YaQueryParameter parameter)Beta
Returns only the first entity contacted with the raycast.
originorigindirectiondirectionparameterrefer to YaQueryParameter
Queries for all entities in a certain area.
originorigin