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

#include <bullet.h>

Inheritance diagram for Bullet:
DynamicWorld::BulletCallback

Public Types

enum  Flg : uint8_t { NoFlags = 0 , Stopped = 1 }
 

Public Member Functions

 Bullet ()=default
 
 Bullet (World &owner, const Item &itm, const Tempest::Vec3 &pos)
 
 Bullet (Bullet &&)=default
 
 ~Bullet () override
 
Bulletoperator= (Bullet &&)=default
 
void setPosition (const Tempest::Vec3 &p)
 
void setPosition (float x, float y, float z)
 
void setDirection (const Tempest::Vec3 &dir)
 
void setTargetRange (float tgRange)
 
void setView (MeshObjects::Mesh &&m)
 
void setView (Effect &&p)
 
bool isSpell () const
 
int32_t spellId () const
 
void setOrigin (Npc *n)
 
Npcorigin () const
 
void setTarget (const Npc *n)
 
Flg flags () const
 
void setFlags (Flg f)
 
ItemMaterial itemMaterial () const
 
auto damage () const -> const DamageCalculator::Damage &
 
void setDamage (DamageCalculator::Damage d)
 
float critChance () const
 
void setCritChance (float v)
 
float hitChance () const
 
void setHitChance (float v)
 
bool isFinished () const
 
float pathLength () const
 
- Public Member Functions inherited from DynamicWorld::BulletCallback
virtual ~BulletCallback ()=default
 

Protected Member Functions

void onStop () override
 
void onMove () override
 
void onCollide (zenkit::MaterialGroup matId) override
 
bool onCollide (Npc &other) override
 

Detailed Description

Definition at line 15 of file bullet.h.

Member Enumeration Documentation

◆ Flg

enum Bullet::Flg : uint8_t
Enumerator
NoFlags 
Stopped 

Definition at line 23 of file bullet.h.

Constructor & Destructor Documentation

◆ Bullet() [1/3]

Bullet::Bullet ( )
default

◆ Bullet() [2/3]

Bullet::Bullet ( World owner,
const Item itm,
const Tempest::Vec3 &  pos 
)

◆ Bullet() [3/3]

Bullet::Bullet ( Bullet &&  )
default

◆ ~Bullet()

Bullet::~Bullet ( )
override

Definition at line 35 of file bullet.cpp.

Member Function Documentation

◆ critChance()

float Bullet::critChance ( ) const
inline

Definition at line 52 of file bullet.h.

◆ damage()

auto Bullet::damage ( ) const -> const DamageCalculator::Damage&
inline

Definition at line 49 of file bullet.h.

◆ flags()

Flg Bullet::flags ( ) const
inline

Definition at line 45 of file bullet.h.

◆ hitChance()

float Bullet::hitChance ( ) const
inline

Definition at line 54 of file bullet.h.

◆ isFinished()

bool Bullet::isFinished ( ) const

Definition at line 100 of file bullet.cpp.

◆ isSpell()

bool Bullet::isSpell ( ) const

Definition at line 73 of file bullet.cpp.

◆ itemMaterial()

ItemMaterial Bullet::itemMaterial ( ) const

Definition at line 94 of file bullet.cpp.

◆ onCollide() [1/2]

bool Bullet::onCollide ( Npc other)
overrideprotectedvirtual

Reimplemented from DynamicWorld::BulletCallback.

Definition at line 134 of file bullet.cpp.

◆ onCollide() [2/2]

void Bullet::onCollide ( zenkit::MaterialGroup  matId)
overrideprotectedvirtual

Reimplemented from DynamicWorld::BulletCallback.

Definition at line 119 of file bullet.cpp.

◆ onMove()

void Bullet::onMove ( )
overrideprotectedvirtual

Reimplemented from DynamicWorld::BulletCallback.

Definition at line 115 of file bullet.cpp.

◆ onStop()

void Bullet::onStop ( )
overrideprotectedvirtual

Reimplemented from DynamicWorld::BulletCallback.

Definition at line 110 of file bullet.cpp.

◆ operator=()

Bullet & Bullet::operator= ( Bullet &&  )
default

◆ origin()

Npc * Bullet::origin ( ) const

Definition at line 86 of file bullet.cpp.

◆ pathLength()

float Bullet::pathLength ( ) const

Definition at line 106 of file bullet.cpp.

◆ setCritChance()

void Bullet::setCritChance ( float  v)
inline

Definition at line 53 of file bullet.h.

◆ setDamage()

void Bullet::setDamage ( DamageCalculator::Damage  d)
inline

Definition at line 50 of file bullet.h.

◆ setDirection()

void Bullet::setDirection ( const Tempest::Vec3 &  dir)

Definition at line 50 of file bullet.cpp.

◆ setFlags()

void Bullet::setFlags ( Flg  f)
inline

Definition at line 46 of file bullet.h.

◆ setHitChance()

void Bullet::setHitChance ( float  v)
inline

Definition at line 55 of file bullet.h.

◆ setOrigin()

void Bullet::setOrigin ( Npc n)

Definition at line 81 of file bullet.cpp.

◆ setPosition() [1/2]

void Bullet::setPosition ( const Tempest::Vec3 &  p)

Definition at line 40 of file bullet.cpp.

◆ setPosition() [2/2]

void Bullet::setPosition ( float  x,
float  y,
float  z 
)

Definition at line 45 of file bullet.cpp.

◆ setTarget()

void Bullet::setTarget ( const Npc n)

Definition at line 90 of file bullet.cpp.

◆ setTargetRange()

void Bullet::setTargetRange ( float  tgRange)

Definition at line 55 of file bullet.cpp.

◆ setView() [1/2]

void Bullet::setView ( Effect &&  p)

Definition at line 64 of file bullet.cpp.

◆ setView() [2/2]

void Bullet::setView ( MeshObjects::Mesh &&  m)

Definition at line 59 of file bullet.cpp.

◆ spellId()

int32_t Bullet::spellId ( ) const

Definition at line 77 of file bullet.cpp.


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