OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4ValueProviderX Class Reference

#include <C4MeshAnimation.h>

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

Public Member Functions

 C4ValueProviderX ()
 
 C4ValueProviderX (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 80 of file C4MeshAnimation.h.

Constructor & Destructor Documentation

C4ValueProviderX::C4ValueProviderX ( )
inline

Definition at line 83 of file C4MeshAnimation.h.

83 : Object(nullptr), Begin(Fix0), End(Fix0) {}
const C4Real Fix0
Definition: C4Real.h:312
C4ValueProviderX::C4ValueProviderX ( C4Object object,
C4Real  pos,
C4Real  begin,
C4Real  end,
int32_t  length 
)

Definition at line 216 of file C4MeshAnimation.cpp.

References StdMeshInstanceValueProvider::Value.

216  :
217  Object(object), Begin(begin), End(end), Length(length)
218 {
219  Value = pos;
220 }

Member Function Documentation

void C4ValueProviderX::ClearPointers ( C4Object pObj)
inlineoverridevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 89 of file C4MeshAnimation.h.

89 { if(Object == pObj) Object = nullptr; }
void C4ValueProviderX::CompileFunc ( StdCompiler pComp)
overridevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 247 of file C4MeshAnimation.cpp.

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

248 {
250  pComp->Separator();
251  pComp->Value(Object);
252  pComp->Separator();
253  pComp->Value(Begin);
254  pComp->Separator();
255  pComp->Value(End);
256  pComp->Separator();
257  pComp->Value(Length);
258 }
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:119
void Value(const T &rStruct)
Definition: StdCompiler.h:161
void CompileFunc(C4Real &rValue, StdCompiler *pComp)
Definition: C4Real.cpp:9033

Here is the call graph for this function:

void C4ValueProviderX::DenumeratePointers ( )
inlineoverridevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 88 of file C4MeshAnimation.h.

References C4ObjectPtr::DenumeratePointers().

88 { Object.DenumeratePointers(); }
void DenumeratePointers()
Definition: C4ObjectPtr.cpp:47

Here is the call graph for this function:

bool C4ValueProviderX::Execute ( )
overridevirtual

Implements StdMeshInstanceValueProvider.

Definition at line 222 of file C4MeshAnimation.cpp.

References C4MenuItem::Object, StdMeshInstanceValueProvider::Value, and C4Object::xdir.

223 {
224  // Object might have been removed
225  if(!Object) return false;
226 
227  Value += (End - Begin) * (Object->xdir) / Length;
228 
229  if (End > Begin)
230  {
231  while (Value > End)
232  Value -= (End - Begin);
233  while (Value < Begin)
234  Value += (End - Begin);
235  }
236  else
237  {
238  while (Value > Begin)
239  Value -= (Begin - End);
240  while (Value < End)
241  Value += (Begin - End);
242  }
243 
244  return true;
245 }
C4Real xdir
Definition: C4Object.h:126
static const IDBase* StdMeshInstance::SerializableValueProvider::Lookup ( const char *  name)
inlinestaticinherited

Definition at line 460 of file StdMesh.h.

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

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  }
static const IDBase* StdMeshInstance::SerializableValueProvider::Lookup ( const std::type_info &  type)
inlinestaticinherited

Definition at line 469 of file StdMesh.h.

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

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

Member Data Documentation


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