Leviathan  0.8.0.0
Leviathan game engine
Leviathan::StateHelper Class Reference

#include <CommonStateObjects.h>

+ Inheritance diagram for Leviathan::StateHelper:

Public Member Functions

 StateHelper ()=delete
 
- Public Member Functions inherited from Leviathan::ComponentState
 ComponentState (int32_t tick, COMPONENT_TYPE componenttype)
 
virtual ~ComponentState ()
 
virtual DLLEXPORT void CreateUpdatePacket (ComponentState *olderstate, sf::Packet &packet)=0
 Adds update data to a packet. More...
 
virtual DLLEXPORT bool FillMissingData (ComponentState &otherstate)=0
 Copies data to missing values in this state from another state. More...
 
 ComponentState (const ComponentState &other)=delete
 
void operator= (const ComponentState &other)=delete
 

Static Public Member Functions

static DLLEXPORT Float3 Interpolate (Member< Float3 > &first, Member< Float3 > &second, float progress)
 
static DLLEXPORT Float4 InterpolateQuoternion (Member< Float4 > &first, Member< Float4 > &second, float progress)
 

Additional Inherited Members

- Public Types inherited from Leviathan::ComponentState
template<typename T >
using Member = PotentiallyUpdatedValue< T >
 
- Public Attributes inherited from Leviathan::ComponentState
const int32_t Tick
 The tick this delta state matches. More...
 
const COMPONENT_TYPE ComponentType
 

Detailed Description

Definition at line 9 of file CommonStateObjects.h.

Constructor & Destructor Documentation

◆ StateHelper()

Leviathan::StateHelper::StateHelper ( )
delete

Member Function Documentation

◆ Interpolate()

DLLEXPORT Float3 StateHelper::Interpolate ( Member< Float3 > &  first,
Member< Float3 > &  second,
float  progress 
)
static

Definition at line 10 of file CommonStateObjects.cpp.

12 {
13  Float3 other = second.Value;
14  Float3& full = first.Value;
15 
16  if(!second.IsBitSet(0)) {
17 
18  other.X = full.X;
19  }
20 
21  if(!second.IsBitSet(1)) {
22 
23  other.Y = full.Y;
24  }
25 
26  if(!second.IsBitSet(2)) {
27 
28  other.Z = full.Z;
29  }
30 
31  return full.Lerp(other, progress);
32 }
Definition: lz4.c:260
DLLEXPORT Float3 Lerp(const Float3 &other, float f) const
Definition: Types.h:905

◆ InterpolateQuoternion()

DLLEXPORT Float4 StateHelper::InterpolateQuoternion ( Member< Float4 > &  first,
Member< Float4 > &  second,
float  progress 
)
static

Definition at line 34 of file CommonStateObjects.cpp.

36 {
37 
38  Float4 other = second.Value;
39  Float4& full = first.Value;
40 
41  if(!second.IsBitSet(0)) {
42 
43  other.X = full.X;
44  }
45 
46  if(!second.IsBitSet(1)) {
47 
48  other.Y = full.Y;
49  }
50 
51  if(!second.IsBitSet(2)) {
52 
53  other.Z = full.Z;
54  }
55 
56  if(!second.IsBitSet(3)) {
57 
58  other.W = full.W;
59  }
60 
61  return full.Slerp(other, progress);
62 }
Definition: lz4.c:260
DLLEXPORT Float4 Slerp(const Float4 &other, float f) const
Definition: Types.h:1225

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