OpenClonk
C4ValueProviderY Class Reference

#include <C4MeshAnimation.h>

Inheritance diagram for C4ValueProviderY:
[legend]
Collaboration diagram for C4ValueProviderY:
[legend]

Public Member Functions

 C4ValueProviderY ()
 
 C4ValueProviderY (C4Object *object, C4Real pos, C4Real begin, C4Real end, int32_t length)
 
bool Execute () override
 
void CompileFunc (StdCompiler *pComp) override
 
void DenumeratePointers () override
 
void ClearPointers (C4Object *pObj) override
 

Static Public Member Functions

static const IDBaseLookup (const char *name)
 
static const IDBaseLookup (const std::type_info &type)
 

Public Attributes

C4Real Value
 

Detailed Description

Definition at line 97 of file C4MeshAnimation.h.

Constructor & Destructor Documentation

◆ C4ValueProviderY() [1/2]

C4ValueProviderY::C4ValueProviderY ( )
inline

Definition at line 100 of file C4MeshAnimation.h.

100 : Object(nullptr), Begin(Fix0), End(Fix0) {}
const C4Real Fix0
Definition: C4Real.h:312

◆ C4ValueProviderY() [2/2]

C4ValueProviderY::C4ValueProviderY ( C4Object object,
C4Real  pos,
C4Real  begin,
C4Real  end,
int32_t  length 
)

Definition at line 260 of file C4MeshAnimation.cpp.

260  :
261  Object(object), Begin(begin), End(end), Length(length)
262 {
263  Value = pos;
264 }

References StdMeshInstanceValueProvider::Value.

Member Function Documentation

◆ ClearPointers()

void C4ValueProviderY::ClearPointers ( C4Object pObj)
inlineoverridevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 106 of file C4MeshAnimation.h.

106 { if(Object == pObj) Object = nullptr; }

◆ CompileFunc()

void C4ValueProviderY::CompileFunc ( StdCompiler pComp)
overridevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 291 of file C4MeshAnimation.cpp.

292 {
294  pComp->Separator();
295  pComp->Value(Object);
296  pComp->Separator();
297  pComp->Value(Begin);
298  pComp->Separator();
299  pComp->Value(End);
300  pComp->Separator();
301  pComp->Value(Length);
302 }
void CompileFunc(C4Real &rValue, StdCompiler *pComp)
Definition: C4Real.cpp:9033
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:119
void Value(const T &rStruct)
Definition: StdCompiler.h:161

References CompileFunc(), StdCompiler::Separator(), and StdCompiler::Value().

Here is the call graph for this function:

◆ DenumeratePointers()

void C4ValueProviderY::DenumeratePointers ( )
inlineoverridevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 105 of file C4MeshAnimation.h.

105 { Object.DenumeratePointers(); }
void DenumeratePointers()
Definition: C4ObjectPtr.cpp:49

References C4ObjectPtr::DenumeratePointers().

Here is the call graph for this function:

◆ Execute()

bool C4ValueProviderY::Execute ( )
overridevirtual

Implements StdMeshInstanceValueProvider.

Definition at line 266 of file C4MeshAnimation.cpp.

267 {
268  // Object might have been removed
269  if(!Object) return false;
270 
271  Value += (End - Begin) * (Object->ydir) / Length;
272 
273  if (End > Begin)
274  {
275  while (Value > End)
276  Value -= (End - Begin);
277  while (Value < Begin)
278  Value += (End - Begin);
279  }
280  else
281  {
282  while (Value > Begin)
283  Value -= (Begin - End);
284  while (Value < End)
285  Value += (Begin - End);
286  }
287 
288  return true;
289 }
C4Real ydir
Definition: C4Object.h:124

References StdMeshInstanceValueProvider::Value, and C4Object::ydir.

◆ Lookup() [1/2]

static const IDBase* StdMeshInstance::SerializableValueProvider::Lookup ( const char *  name)
inlinestaticinherited

Definition at line 460 of file StdMesh.h.

461  {
462  if(!IDs) return nullptr;
463  for(auto & ID : *IDs)
464  if(strcmp(ID->name, name) == 0)
465  return ID;
466  return nullptr;
467  }

References StdMeshInstance::SerializableValueProvider::IDBase::name.

◆ Lookup() [2/2]

static const IDBase* StdMeshInstance::SerializableValueProvider::Lookup ( const std::type_info &  type)
inlinestaticinherited

Definition at line 469 of file StdMesh.h.

470  {
471  if(!IDs) return nullptr;
472  for(auto & ID : *IDs)
473  if(ID->type == type)
474  return ID;
475  return nullptr;
476  }

References StdMeshInstance::SerializableValueProvider::IDBase::type.

Member Data Documentation

◆ Value


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