Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
ContactSettings Class Reference

#include <ContactListener.h>

Public Attributes

float mCombinedFriction
 Combined friction for the body pair (see: PhysicsSystem::SetCombineFriction)
 
float mCombinedRestitution
 Combined restitution for the body pair (see: PhysicsSystem::SetCombineRestitution)
 
float mInvMassScale1 = 1.0f
 Scale factor for the inverse mass of body 1 (0 = infinite mass, 1 = use original mass, 2 = body has half the mass). For the same contact pair, you should strive to keep the value the same over time.
 
float mInvInertiaScale1 = 1.0f
 Scale factor for the inverse inertia of body 1 (usually same as mInvMassScale1)
 
float mInvMassScale2 = 1.0f
 Scale factor for the inverse mass of body 2 (0 = infinite mass, 1 = use original mass, 2 = body has half the mass). For the same contact pair, you should strive to keep the value the same over time.
 
float mInvInertiaScale2 = 1.0f
 Scale factor for the inverse inertia of body 2 (usually same as mInvMassScale2)
 
bool mIsSensor
 If the contact should be treated as a sensor vs body contact (no collision response)
 
Vec3 mRelativeLinearSurfaceVelocity = Vec3::sZero()
 Relative linear surface velocity between the bodies (world space surface velocity of body 2 - world space surface velocity of body 1), can be used to create a conveyor belt effect.
 
Vec3 mRelativeAngularSurfaceVelocity = Vec3::sZero()
 Relative angular surface velocity between the bodies (world space angular surface velocity of body 2 - world space angular surface velocity of body 1). Note that this angular velocity is relative to the center of mass of body 1, so if you want it relative to body 2's center of mass you need to add body 2 angular velocity x (body 1 world space center of mass - body 2 world space center of mass) to mRelativeLinearSurfaceVelocity.
 

Detailed Description

When a contact point is added or persisted, the callback gets a chance to override certain properties of the contact constraint. The values are filled in with their defaults by the system so the callback doesn't need to modify anything, but it can if it wants to.

Member Data Documentation

◆ mCombinedFriction

float ContactSettings::mCombinedFriction

Combined friction for the body pair (see: PhysicsSystem::SetCombineFriction)

◆ mCombinedRestitution

float ContactSettings::mCombinedRestitution

Combined restitution for the body pair (see: PhysicsSystem::SetCombineRestitution)

◆ mInvInertiaScale1

float ContactSettings::mInvInertiaScale1 = 1.0f

Scale factor for the inverse inertia of body 1 (usually same as mInvMassScale1)

◆ mInvInertiaScale2

float ContactSettings::mInvInertiaScale2 = 1.0f

Scale factor for the inverse inertia of body 2 (usually same as mInvMassScale2)

◆ mInvMassScale1

float ContactSettings::mInvMassScale1 = 1.0f

Scale factor for the inverse mass of body 1 (0 = infinite mass, 1 = use original mass, 2 = body has half the mass). For the same contact pair, you should strive to keep the value the same over time.

◆ mInvMassScale2

float ContactSettings::mInvMassScale2 = 1.0f

Scale factor for the inverse mass of body 2 (0 = infinite mass, 1 = use original mass, 2 = body has half the mass). For the same contact pair, you should strive to keep the value the same over time.

◆ mIsSensor

bool ContactSettings::mIsSensor

If the contact should be treated as a sensor vs body contact (no collision response)

◆ mRelativeAngularSurfaceVelocity

Vec3 ContactSettings::mRelativeAngularSurfaceVelocity = Vec3::sZero()

Relative angular surface velocity between the bodies (world space angular surface velocity of body 2 - world space angular surface velocity of body 1). Note that this angular velocity is relative to the center of mass of body 1, so if you want it relative to body 2's center of mass you need to add body 2 angular velocity x (body 1 world space center of mass - body 2 world space center of mass) to mRelativeLinearSurfaceVelocity.

◆ mRelativeLinearSurfaceVelocity

Vec3 ContactSettings::mRelativeLinearSurfaceVelocity = Vec3::sZero()

Relative linear surface velocity between the bodies (world space surface velocity of body 2 - world space surface velocity of body 1), can be used to create a conveyor belt effect.


The documentation for this class was generated from the following file: