OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
MoveAlgo Class Referencefinal

#include <movealgo.h>

Classes

struct  JumpStatus
 

Public Types

enum  MvFlags { NoFlag = 0 , FaiMove = 1 , WaitMove = 1<<1 }
 

Public Member Functions

 MoveAlgo (Npc &unit)
 
void load (Serialize &fin)
 
void save (Serialize &fout) const
 
void tick (uint64_t dt, MvFlags fai=NoFlag)
 
void multSpeed (float s)
 
void clearSpeed ()
 
void accessDamFly (float dx, float dz)
 
bool testSlide (const Tempest::Vec3 &p, DynamicWorld::CollisionTest &out, bool cont=false) const
 
bool startClimb (JumpStatus ani)
 
void startDive ()
 
bool isFalling () const
 
bool isSlide () const
 
bool isInAir () const
 
bool isJumpup () const
 
bool isClimb () const
 
bool isInWater () const
 
bool isSwim () const
 
bool isDive () const
 
zenkit::MaterialGroup groundMaterial () const
 
auto groundNormal () const -> Tempest::Vec3
 
auto portalName () -> std::string_view
 
auto formerPortalName () -> std::string_view
 
int32_t diveTime () const
 
float waterDepthKnee () const
 
float waterDepthChest () const
 
bool canFlyOverWater () const
 
bool checkLastBounce () const
 

Static Public Member Functions

static bool isClose (const Npc &npc, const Npc &p, float dist)
 
static bool isClose (const Npc &npc, const WayPoint &p)
 
static bool isClose (const Npc &npc, const WayPoint &p, float dist)
 
static bool isClose (const Npc &npc, const Tempest::Vec3 &p, float dist)
 

Static Public Attributes

static const float closeToPointThreshold = 40
 
static const float climbMove = 55
 

Detailed Description

Definition at line 18 of file movealgo.h.

Member Enumeration Documentation

◆ MvFlags

Enumerator
NoFlag 
FaiMove 
WaitMove 

Definition at line 31 of file movealgo.h.

Constructor & Destructor Documentation

◆ MoveAlgo()

MoveAlgo::MoveAlgo ( Npc unit)

Definition at line 15 of file movealgo.cpp.

Member Function Documentation

◆ accessDamFly()

void MoveAlgo::accessDamFly ( float  dx,
float  dz 
)

Definition at line 536 of file movealgo.cpp.

◆ canFlyOverWater()

bool MoveAlgo::canFlyOverWater ( ) const

Definition at line 673 of file movealgo.cpp.

◆ checkLastBounce()

bool MoveAlgo::checkLastBounce ( ) const

Definition at line 680 of file movealgo.cpp.

◆ clearSpeed()

void MoveAlgo::clearSpeed ( )

Definition at line 529 of file movealgo.cpp.

◆ diveTime()

int32_t MoveAlgo::diveTime ( ) const

Definition at line 703 of file movealgo.cpp.

◆ formerPortalName()

std::string_view MoveAlgo::formerPortalName ( ) -> std::string_view

Definition at line 1093 of file movealgo.cpp.

◆ groundMaterial()

zenkit::MaterialGroup MoveAlgo::groundMaterial ( ) const

Definition at line 1078 of file movealgo.cpp.

◆ groundNormal()

Tempest::Vec3 MoveAlgo::groundNormal ( ) const -> Tempest::Vec3

Definition at line 1085 of file movealgo.cpp.

◆ isClimb()

bool MoveAlgo::isClimb ( ) const

Definition at line 816 of file movealgo.cpp.

◆ isClose() [1/4]

bool MoveAlgo::isClose ( const Npc npc,
const Npc p,
float  dist 
)
static

Definition at line 709 of file movealgo.cpp.

◆ isClose() [2/4]

bool MoveAlgo::isClose ( const Npc npc,
const Tempest::Vec3 &  p,
float  dist 
)
static

Definition at line 737 of file movealgo.cpp.

◆ isClose() [3/4]

bool MoveAlgo::isClose ( const Npc npc,
const WayPoint p 
)
static

Definition at line 722 of file movealgo.cpp.

◆ isClose() [4/4]

bool MoveAlgo::isClose ( const Npc npc,
const WayPoint p,
float  dist 
)
static

Definition at line 729 of file movealgo.cpp.

◆ isDive()

bool MoveAlgo::isDive ( ) const

Definition at line 828 of file movealgo.cpp.

◆ isFalling()

bool MoveAlgo::isFalling ( ) const

Definition at line 800 of file movealgo.cpp.

◆ isInAir()

bool MoveAlgo::isInAir ( ) const

Definition at line 808 of file movealgo.cpp.

◆ isInWater()

bool MoveAlgo::isInWater ( ) const

Definition at line 820 of file movealgo.cpp.

◆ isJumpup()

bool MoveAlgo::isJumpup ( ) const

Definition at line 812 of file movealgo.cpp.

◆ isSlide()

bool MoveAlgo::isSlide ( ) const

Definition at line 804 of file movealgo.cpp.

◆ isSwim()

bool MoveAlgo::isSwim ( ) const

Definition at line 824 of file movealgo.cpp.

◆ load()

void MoveAlgo::load ( Serialize fin)

Definition at line 19 of file movealgo.cpp.

◆ multSpeed()

void MoveAlgo::multSpeed ( float  s)
inline

Definition at line 47 of file movealgo.h.

◆ portalName()

std::string_view MoveAlgo::portalName ( ) -> std::string_view

Definition at line 1089 of file movealgo.cpp.

◆ save()

void MoveAlgo::save ( Serialize fout) const

Definition at line 33 of file movealgo.cpp.

◆ startClimb()

bool MoveAlgo::startClimb ( JumpStatus  ani)

Definition at line 746 of file movealgo.cpp.

◆ startDive()

void MoveAlgo::startDive ( )

Definition at line 786 of file movealgo.cpp.

◆ testSlide()

bool MoveAlgo::testSlide ( const Tempest::Vec3 &  p,
DynamicWorld::CollisionTest out,
bool  cont = false 
) const

Definition at line 620 of file movealgo.cpp.

◆ tick()

void MoveAlgo::tick ( uint64_t  dt,
MvFlags  fai = NoFlag 
)

Definition at line 441 of file movealgo.cpp.

◆ waterDepthChest()

float MoveAlgo::waterDepthChest ( ) const

Definition at line 668 of file movealgo.cpp.

◆ waterDepthKnee()

float MoveAlgo::waterDepthKnee ( ) const

Definition at line 663 of file movealgo.cpp.

Member Data Documentation

◆ climbMove

const float MoveAlgo::climbMove = 55
static

Definition at line 21 of file movealgo.h.

◆ closeToPointThreshold

const float MoveAlgo::closeToPointThreshold = 40
static

Definition at line 20 of file movealgo.h.


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