Character Controller Pro  1.3.8
A 2D/3D character controller asset for the Unity Engine.
Lightbug.CharacterControllerPro.Core.PhysicsActor Class Reference

A physics-based actor that represents a custom 2D/3D interpolated rigidbody. More...

Inheritance diagram for Lightbug.CharacterControllerPro.Core.PhysicsActor:
Lightbug.CharacterControllerPro.Core.CharacterActor

Public Types

enum  RootMotionVelocityType { RootMotionVelocityType.SetVelocity, RootMotionVelocityType.SetPlanarVelocity, RootMotionVelocityType.SetVerticalVelocity }
 Defines how the root velocity data is going to be applied to the actor. More...
 
enum  RootMotionRotationType { RootMotionRotationType.SetRotation, RootMotionRotationType.AddRotation }
 Defines how the root rotation data is going to be applied to the actor. More...
 

Public Member Functions

void SyncBody ()
 
void InitializeAnimation (Animator animator)
 Configures all the animation-related components based on a given Animator component. The Animator provides root motion data along More...
 
void ResetIKWeights ()
 
void ResetInterpolationPosition ()
 
void ResetInterpolationRotation ()
 

Public Attributes

bool interpolateActor = true
 
bool useContinuousCollisionDetection = true
 
bool UseRootMotion = false
 
bool UpdateRootPosition = true
 
RootMotionVelocityType rootMotionVelocityType = RootMotionVelocityType.SetVelocity
 
bool UpdateRootRotation = true
 
RootMotionRotationType rootMotionRotationType = RootMotionRotationType.AddRotation
 

Protected Member Functions

virtual void Awake ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 
virtual void Start ()
 
virtual void PreSimulationUpdate (float dt)
 
virtual void PostSimulationUpdate (float dt)
 
virtual void UpdateKinematicRootMotionPosition (Vector3 deltaPosition)
 
virtual void UpdateKinematicRootMotionRotation (Quaternion deltaRotation)
 
virtual void UpdateDynamicRootMotionPosition (Vector3 deltaPosition)
 
virtual void UpdateDynamicRootMotionRotation (Quaternion deltaRotation)
 

Properties

abstract RigidbodyComponent RigidbodyComponent [get]
 Gets the RigidbodyComponent component associated with the character. More...
 
Animator Animator [get]
 Gets the Animator component associated with the state controller. More...
 
float InterpolationFactor [get]
 Returns a value between 0 and 1 that represents the interpolation t factor used by the interpolation algorithm. If the current time value (Time.time) is close to the most recent fixed time (Time.fixedTime), then the factor will be close to 0. On the other hand, if the current time is close to the next fixed time value (Time.fixedTime + Time.fixedDeltaTime) then the factor will be close to 1. More...
 

Events

System.Action< float > OnPreSimulation
 This event is called prior to the physics simulation. More...
 
System.Action< float > OnPostSimulation
 This event is called after the physics simulation. More...
 
System.Action< Vector3, Quaternion > OnAnimatorMoveEvent
 
System.Action< int > OnAnimatorIKEvent
 

Detailed Description

A physics-based actor that represents a custom 2D/3D interpolated rigidbody.

Member Enumeration Documentation

◆ RootMotionRotationType

Defines how the root rotation data is going to be applied to the actor.

Enumerator
SetRotation 

The root motion rotation will override the current rotation.

AddRotation 

The root motion rotation will be added to the current rotation.

◆ RootMotionVelocityType

Defines how the root velocity data is going to be applied to the actor.

Enumerator
SetVelocity 

The root motion velocity will be applied as velocity.

SetPlanarVelocity 

The root motion velocity will be applied as planar velocity.

SetVerticalVelocity 

The root motion velocity will be applied as vertical velocity.

Member Function Documentation

◆ InitializeAnimation()

void Lightbug.CharacterControllerPro.Core.PhysicsActor.InitializeAnimation ( Animator  animator)
inline

Configures all the animation-related components based on a given Animator component. The Animator provides root motion data along

Property Documentation

◆ Animator

Animator Lightbug.CharacterControllerPro.Core.PhysicsActor.Animator
get

Gets the Animator component associated with the state controller.

◆ InterpolationFactor

float Lightbug.CharacterControllerPro.Core.PhysicsActor.InterpolationFactor
get

Returns a value between 0 and 1 that represents the interpolation t factor used by the interpolation algorithm. If the current time value (Time.time) is close to the most recent fixed time (Time.fixedTime), then the factor will be close to 0. On the other hand, if the current time is close to the next fixed time value (Time.fixedTime + Time.fixedDeltaTime) then the factor will be close to 1.

◆ RigidbodyComponent

abstract RigidbodyComponent Lightbug.CharacterControllerPro.Core.PhysicsActor.RigidbodyComponent
get

Gets the RigidbodyComponent component associated with the character.

Event Documentation

◆ OnPostSimulation

System.Action<float> Lightbug.CharacterControllerPro.Core.PhysicsActor.OnPostSimulation

This event is called after the physics simulation.

◆ OnPreSimulation

System.Action<float> Lightbug.CharacterControllerPro.Core.PhysicsActor.OnPreSimulation

This event is called prior to the physics simulation.


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