Nebula
Loading...
Searching...
No Matches
Physics::CharacterContext Class Reference

#include <charactercontext.h>

Static Public Member Functions

static CharacterId CreateCharacter (Math::vec3 const &position, CharacterCreateInfo const &info, IndexT scene=0)
 
static void DestroyCharacter (CharacterId characterId)
 
static CharacterGetCharacter (CharacterId id)
 
static void SetCharacterBoxSize (CharacterId characterId, Math::vec3 const &halfExtents)
 Sets the characters half extents. Character needs to be of box type.
 
static void SetCharacterHeight (CharacterId characterId, float newHeight)
 Sets the characters height, and adjusts the position so that it doesn't "pop" into the air.
 
static void SetCharacterPosition (CharacterId characterId, Math::vec3 const &newPosition)
 Immediately changes the character world position without doing any collision checks.
 
static Math::vec3 GetCharacterCenterPosition (CharacterId characterId)
 Get the character center point.
 
static Math::vec3 GetCharacterFootPosition (CharacterId characterId)
 Get the position of the lowest point of the characters collider in worldspace.
 
static CharacterCollision MoveCharacter (CharacterId characterId, Math::vector const &displacement, float minDist, float timeSinceLastMove)
 Displace a character, and check/resolve collisions along the way.
 

Member Function Documentation

◆ CreateCharacter()

CharacterId Physics::CharacterContext::CreateCharacter ( Math::vec3 const & position,
CharacterCreateInfo const & info,
IndexT scene = 0 )
static

◆ DestroyCharacter()

void Physics::CharacterContext::DestroyCharacter ( CharacterId characterId)
static

◆ GetCharacter()

Character & Physics::CharacterContext::GetCharacter ( CharacterId id)
static

◆ GetCharacterCenterPosition()

Math::vec3 Physics::CharacterContext::GetCharacterCenterPosition ( CharacterId characterId)
static

Get the character center point.

See also
GetCharacterFootPosition for getting lowest point of the collider

◆ GetCharacterFootPosition()

Math::vec3 Physics::CharacterContext::GetCharacterFootPosition ( CharacterId characterId)
static

Get the position of the lowest point of the characters collider in worldspace.

◆ MoveCharacter()

CharacterCollision Physics::CharacterContext::MoveCharacter ( CharacterId characterId,
Math::vector const & displacement,
float minDist,
float timeSinceLastMove )
static

Displace a character, and check/resolve collisions along the way.

Parameters
minDistThe minimum travelled distance to consider. If travelled distance is smaller, the character doesn’t move.
timeSinceLastMoveis the amount of time that passed since the last call to the move function.

◆ SetCharacterBoxSize()

void Physics::CharacterContext::SetCharacterBoxSize ( CharacterId characterId,
Math::vec3 const & halfExtents )
static

Sets the characters half extents. Character needs to be of box type.

◆ SetCharacterHeight()

void Physics::CharacterContext::SetCharacterHeight ( CharacterId characterId,
float newHeight )
static

Sets the characters height, and adjusts the position so that it doesn't "pop" into the air.

◆ SetCharacterPosition()

void Physics::CharacterContext::SetCharacterPosition ( CharacterId characterId,
Math::vec3 const & newPosition )
static

Immediately changes the character world position without doing any collision checks.


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