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

#include <C4MeshAnimation.h>

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

Public Member Functions

 C4ValueProviderXDir ()
 
 C4ValueProviderXDir (C4Object *object, C4Real begin, C4Real end, C4Real max_xdir)
 
virtual bool Execute ()
 
virtual void CompileFunc (StdCompiler *pComp)
 
virtual void DenumeratePointers ()
 
virtual void ClearPointers (C4Object *pObj)
 

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 181 of file C4MeshAnimation.h.

Constructor & Destructor Documentation

C4ValueProviderXDir::C4ValueProviderXDir ( )
inline

Definition at line 184 of file C4MeshAnimation.h.

184 : Object(nullptr), Begin(Fix0), End(Fix0), MaxXDir(Fix0) {}
const C4Real Fix0
Definition: C4Real.h:312
C4ValueProviderXDir::C4ValueProviderXDir ( C4Object object,
C4Real  begin,
C4Real  end,
C4Real  max_xdir 
)

Definition at line 451 of file C4MeshAnimation.cpp.

References Execute().

451  :
452  Object(object), Begin(begin), End(end), MaxXDir(max_xdir)
453 {
454  Execute();
455 }
virtual bool Execute()

Here is the call graph for this function:

Member Function Documentation

virtual void C4ValueProviderXDir::ClearPointers ( C4Object pObj)
inlinevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 190 of file C4MeshAnimation.h.

190 { if(Object == pObj) Object = nullptr; }
void C4ValueProviderXDir::CompileFunc ( StdCompiler pComp)
virtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 466 of file C4MeshAnimation.cpp.

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

467 {
469  pComp->Separator();
470  pComp->Value(Object);
471  pComp->Separator();
472  pComp->Value(Begin);
473  pComp->Separator();
474  pComp->Value(End);
475  pComp->Separator();
476  pComp->Value(MaxXDir);
477 }
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:129
void Value(const T &rStruct)
Definition: StdCompiler.h:171
void CompileFunc(C4Real &rValue, StdCompiler *pComp)
Definition: C4Real.cpp:9033

Here is the call graph for this function:

virtual void C4ValueProviderXDir::DenumeratePointers ( )
inlinevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 189 of file C4MeshAnimation.h.

References C4ObjectPtr::DenumeratePointers().

189 { Object.DenumeratePointers(); }
void DenumeratePointers()
Definition: C4ObjectPtr.cpp:46

Here is the call graph for this function:

bool C4ValueProviderXDir::Execute ( )
virtual

Implements StdMeshInstanceValueProvider.

Definition at line 457 of file C4MeshAnimation.cpp.

References Abs(), itofix(), C4MenuItem::Object, StdMeshInstanceValueProvider::Value, and C4Object::xdir.

Referenced by C4ValueProviderXDir().

458 {
459  // Object might have been removed
460  if(!Object) return false;
461 
462  Value = Begin + (End - Begin) * std::min<C4Real>(Abs(Object->xdir/MaxXDir), itofix(1));
463  return true;
464 }
C4Fixed itofix(int32_t x)
Definition: C4Real.h:261
T Abs(T val)
Definition: Standard.h:44
C4Real xdir
Definition: C4Object.h:126

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 462 of file StdMesh.h.

463  {
464  if(!IDs) return nullptr;
465  for(unsigned int i = 0; i < IDs->size(); ++i)
466  if(strcmp((*IDs)[i]->name, name) == 0)
467  return (*IDs)[i];
468  return nullptr;
469  }
static const IDBase* StdMeshInstance::SerializableValueProvider::Lookup ( const std::type_info &  type)
inlinestaticinherited

Definition at line 471 of file StdMesh.h.

472  {
473  if(!IDs) return nullptr;
474  for(unsigned int i = 0; i < IDs->size(); ++i)
475  if((*IDs)[i]->type == type)
476  return (*IDs)[i];
477  return nullptr;
478  }

Member Data Documentation


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