C# Класс Steer, urban-survivors

Наследование: MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
brakingRate float
mass float
maxForce float
maxSpeed float

Защищенные свойства (Protected)

Свойство Тип Описание
controller CharacterController
curSpeed float
smoothedAcceleration Vector3

Открытые методы

Метод Описание
ApplyBrakingForce ( ) : void
ApplySteeringForce ( Vector3 _force ) : void
BrakeImmediately ( ) : void
CurSpeed ( ) : float
GetSteering_AvoidObstacle ( float _minTimeToCollision, Collider _obstacle ) : Vector3
GetSteering_Flee ( Vector3 _pos ) : Vector3
GetSteering_Flee_LimitByMaxSpeed ( Vector3 _pos ) : Vector3
GetSteering_Flee_MaxForces ( Vector3 _pos ) : Vector3
GetSteering_Seek ( Vector3 _pos ) : Vector3
GetSteering_Seek_LimitByMaxSpeed ( Vector3 _pos ) : Vector3
GetSteering_Seek_MaxForces ( Vector3 _pos ) : Vector3
GetSteering_Wander ( ) : Vector3
IsAhead ( Vector3 _targetPos, float _cosThreshold = 0.707f ) : bool
IsAside ( Vector3 _targetPos, float _cosThreshold = 0.707f ) : bool
IsBehind ( Vector3 _targetPos, float _cosThreshold = -0.707f ) : bool
Velocity ( ) : Vector3

Защищенные методы

Метод Описание
AdjustOrientation ( Vector3 _newVelocity ) : void
Awake ( ) : void
ShowDebugInfo ( ) : void
Start ( ) : void
Update ( ) : void

Приватные методы

Метод Описание
AdjustRawSteeringForce ( Vector3 _force ) : Vector3

Описание методов

AdjustOrientation() защищенный Метод

protected AdjustOrientation ( Vector3 _newVelocity ) : void
_newVelocity Vector3
Результат void

ApplyBrakingForce() публичный Метод

public ApplyBrakingForce ( ) : void
Результат void

ApplySteeringForce() публичный Метод

public ApplySteeringForce ( Vector3 _force ) : void
_force Vector3
Результат void

Awake() защищенный Метод

protected Awake ( ) : void
Результат void

BrakeImmediately() публичный Метод

public BrakeImmediately ( ) : void
Результат void

CurSpeed() публичный Метод

public CurSpeed ( ) : float
Результат float

GetSteering_AvoidObstacle() публичный Метод

public GetSteering_AvoidObstacle ( float _minTimeToCollision, Collider _obstacle ) : Vector3
_minTimeToCollision float
_obstacle Collider
Результат Vector3

GetSteering_Flee() публичный Метод

public GetSteering_Flee ( Vector3 _pos ) : Vector3
_pos Vector3
Результат Vector3

GetSteering_Flee_LimitByMaxSpeed() публичный Метод

public GetSteering_Flee_LimitByMaxSpeed ( Vector3 _pos ) : Vector3
_pos Vector3
Результат Vector3

GetSteering_Flee_MaxForces() публичный Метод

public GetSteering_Flee_MaxForces ( Vector3 _pos ) : Vector3
_pos Vector3
Результат Vector3

GetSteering_Seek() публичный Метод

public GetSteering_Seek ( Vector3 _pos ) : Vector3
_pos Vector3
Результат Vector3

GetSteering_Seek_LimitByMaxSpeed() публичный Метод

public GetSteering_Seek_LimitByMaxSpeed ( Vector3 _pos ) : Vector3
_pos Vector3
Результат Vector3

GetSteering_Seek_MaxForces() публичный Метод

public GetSteering_Seek_MaxForces ( Vector3 _pos ) : Vector3
_pos Vector3
Результат Vector3

GetSteering_Wander() публичный Метод

public GetSteering_Wander ( ) : Vector3
Результат Vector3

IsAhead() публичный Метод

public IsAhead ( Vector3 _targetPos, float _cosThreshold = 0.707f ) : bool
_targetPos Vector3
_cosThreshold float
Результат bool

IsAside() публичный Метод

public IsAside ( Vector3 _targetPos, float _cosThreshold = 0.707f ) : bool
_targetPos Vector3
_cosThreshold float
Результат bool

IsBehind() публичный Метод

public IsBehind ( Vector3 _targetPos, float _cosThreshold = -0.707f ) : bool
_targetPos Vector3
_cosThreshold float
Результат bool

ShowDebugInfo() защищенный Метод

protected ShowDebugInfo ( ) : void
Результат void

Start() защищенный Метод

protected Start ( ) : void
Результат void

Update() защищенный Метод

protected Update ( ) : void
Результат void

Velocity() публичный Метод

public Velocity ( ) : Vector3
Результат Vector3

Описание свойств

brakingRate публичное свойство

public float brakingRate
Результат float

controller защищенное свойство

protected CharacterController controller
Результат CharacterController

curSpeed защищенное свойство

protected float curSpeed
Результат float

mass публичное свойство

public float mass
Результат float

maxForce публичное свойство

public float maxForce
Результат float

maxSpeed публичное свойство

public float maxSpeed
Результат float

smoothedAcceleration защищенное свойство

protected Vector3 smoothedAcceleration
Результат Vector3