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

#include <C4MeshAnimation.h>

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

Public Member Functions

 C4ValueProviderYDir ()
 
 C4ValueProviderYDir (C4Object *object, C4Real begin, C4Real end, C4Real max_ydir)
 
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 198 of file C4MeshAnimation.h.

Constructor & Destructor Documentation

C4ValueProviderYDir::C4ValueProviderYDir ( )
inline

Definition at line 201 of file C4MeshAnimation.h.

201 : Object(nullptr), Begin(Fix0), End(Fix0), MaxYDir(Fix0) {}
const C4Real Fix0
Definition: C4Real.h:312
C4ValueProviderYDir::C4ValueProviderYDir ( C4Object object,
C4Real  begin,
C4Real  end,
C4Real  max_ydir 
)

Definition at line 479 of file C4MeshAnimation.cpp.

References Execute().

479  :
480  Object(object), Begin(begin), End(end), MaxYDir(max_ydir)
481 {
482  Execute();
483 }
bool Execute() override

Here is the call graph for this function:

Member Function Documentation

void C4ValueProviderYDir::ClearPointers ( C4Object pObj)
inlineoverridevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 207 of file C4MeshAnimation.h.

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

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 494 of file C4MeshAnimation.cpp.

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

495 {
497  pComp->Separator();
498  pComp->Value(Object);
499  pComp->Separator();
500  pComp->Value(Begin);
501  pComp->Separator();
502  pComp->Value(End);
503  pComp->Separator();
504  pComp->Value(MaxYDir);
505 }
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 C4ValueProviderYDir::DenumeratePointers ( )
inlineoverridevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 206 of file C4MeshAnimation.h.

References C4ObjectPtr::DenumeratePointers().

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

Here is the call graph for this function:

bool C4ValueProviderYDir::Execute ( )
overridevirtual

Implements StdMeshInstanceValueProvider.

Definition at line 485 of file C4MeshAnimation.cpp.

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

Referenced by C4ValueProviderYDir().

486 {
487  // Object might have been removed
488  if(!Object) return false;
489 
490  Value = Begin + (End - Begin) * std::min<C4Real>(Abs(Object->ydir/MaxYDir), itofix(1));
491  return true;
492 }
C4Fixed itofix(int32_t x)
Definition: C4Real.h:261
T Abs(T val)
Definition: Standard.h:42
C4Real ydir
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 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: