SF Tool Documentation
Search Results for

    Show / Hide Table of Contents

    Class ControllerBody2D

    The base class for high performance physics controller that uses Unity's Low Level Physics2D system to allow for highly customizable physics that can even destroy, edit, and manipulate physics shapes in real time.

    Inheritance
    System.Object
    PhysicController2D
    ControllerBody2D
    PlayerController
    Implements
    IForceReceiver
    Inherited Members
    PhysicController2D.ReferenceSpeed
    PhysicController2D.DefaultPhysics
    PhysicController2D.CurrentPhysics
    PhysicController2D.PhysicsVolumeType
    PhysicController2D.Direction
    PhysicController2D._direction
    PhysicController2D._directionLastFrame
    PhysicController2D._previousDirection
    PhysicController2D.OnDirectionChanged
    PhysicController2D._calculatedVelocity
    PhysicController2D._externalVelocity
    PhysicController2D.CurrentVelocity
    PhysicController2D.IsFrozen
    PhysicController2D.Init()
    PhysicController2D.OnInit()
    PhysicController2D.OnStart()
    PhysicController2D.OnLateUpdate()
    PhysicController2D.OnPreFixedUpdate()
    PhysicController2D.FreezeController()
    PhysicController2D.UnfreezeController()
    PhysicController2D.SetExternalVelocity(Vector2)
    PhysicController2D.SetDirectionalForce(Vector2)
    PhysicController2D.AddVelocity(Vector2)
    PhysicController2D.AddHorizontalVelocity(Single)
    PhysicController2D.AddVerticalVelocity(Single)
    PhysicController2D.SetVelocity(Vector2)
    PhysicController2D.SetHorizontalVelocity(Single)
    PhysicController2D.SetVerticalVelocity(Single)
    PhysicController2D.SetDirection(Single)
    Namespace: SF.PhysicsLowLevel
    Assembly: cs.temp.dll.dll
    Syntax
    public class ControllerBody2D : PhysicController2D, IForceReceiver
    Remarks

    This can be used for Character Controllers, real time editable terrain (think Team 17 Worms games), and fast pace physics based 2D games that need high performance.

    Fields

    _character

    Declaration
    protected CharacterRenderer2D _character
    Field Value
    Type Description
    CharacterRenderer2D

    CharacterState

    Declaration
    public CharacterState CharacterState
    Field Value
    Type Description
    CharacterState

    CollisionInfo

    Declaration
    public BodyCollisionInfo CollisionInfo
    Field Value
    Type Description
    BodyCollisionInfo

    DebugMode

    Should the debug rendering and log system be active.

    Declaration
    public bool DebugMode
    Field Value
    Type Description
    System.Boolean
    Remarks

    Debug rendering works in builds and in editor, but requires a device that supports compute shaders. WebGL doesn't work, but WebGPU does work.

    IsCrouching

    Declaration
    public bool IsCrouching
    Field Value
    Type Description
    System.Boolean

    IsFalling

    Declaration
    public bool IsFalling
    Field Value
    Type Description
    System.Boolean

    IsGliding

    Declaration
    public bool IsGliding
    Field Value
    Type Description
    System.Boolean

    IsJumping

    Declaration
    public bool IsJumping
    Field Value
    Type Description
    System.Boolean

    IsRunning

    Declaration
    public bool IsRunning
    Field Value
    Type Description
    System.Boolean

    IsSwimming

    Declaration
    public bool IsSwimming
    Field Value
    Type Description
    System.Boolean

    ShapeComponent

    The SFShapeComponent that is defining the physics shape and physics body of the controller.

    Declaration
    public SFShapeComponent ShapeComponent
    Field Value
    Type Description
    SFShapeComponent

    Properties

    IsClimbing

    Declaration
    public bool IsClimbing { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    CalculateHorizontal()

    Declaration
    protected override void CalculateHorizontal()
    Overrides
    PhysicController2D.CalculateHorizontal()

    CalculateMovementState()

    Declaration
    protected override void CalculateMovementState()
    Overrides
    PhysicController2D.CalculateMovementState()

    CalculateVertical()

    Declaration
    protected override void CalculateVertical()
    Overrides
    PhysicController2D.CalculateVertical()

    FixedUpdate()

    Declaration
    protected override void FixedUpdate()
    Overrides
    PhysicController2D.FixedUpdate()

    Move()

    Declaration
    protected override void Move()
    Overrides
    PhysicController2D.Move()

    OnAwake()

    Declaration
    protected override void OnAwake()
    Overrides
    PhysicController2D.OnAwake()

    ResetColliderSize()

    Declaration
    public void ResetColliderSize()

    ResetPhysics(MovementProperties)

    Declaration
    public virtual void ResetPhysics(MovementProperties movementProperties)
    Parameters
    Type Name Description
    MovementProperties movementProperties

    ResizeCollider(Vector2)

    Declaration
    public void ResizeCollider(Vector2 newSize)
    Parameters
    Type Name Description
    Vector2 newSize

    UpdatePhysicsProperties(MovementProperties, PhysicsVolumeType)

    Declaration
    public virtual void UpdatePhysicsProperties(MovementProperties movementProperties, PhysicsVolumeType volumeType = PhysicsVolumeType.None)
    Parameters
    Type Name Description
    MovementProperties movementProperties
    PhysicsVolumeType volumeType

    Implements

    IForceReceiver
    In This Article
    Back to top Generated by DocFX