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

#include <C4MeshAnimation.h>

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

Public Member Functions

 C4ValueProviderRDir ()
 
 C4ValueProviderRDir (C4Object *object, C4Real begin, C4Real end, C4Real min_rdir, C4Real max_rdir)
 
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 215 of file C4MeshAnimation.h.

Constructor & Destructor Documentation

C4ValueProviderRDir::C4ValueProviderRDir ( )
inline

Definition at line 218 of file C4MeshAnimation.h.

218 : Object(nullptr), Begin(Fix0), End(Fix0), MinRDir(Fix0), MaxRDir(Fix0) {}
const C4Real Fix0
Definition: C4Real.h:312
C4ValueProviderRDir::C4ValueProviderRDir ( C4Object object,
C4Real  begin,
C4Real  end,
C4Real  min_rdir,
C4Real  max_rdir 
)

Definition at line 507 of file C4MeshAnimation.cpp.

References Execute().

507  :
508  Object(object), Begin(begin), End(end), MinRDir(min_rdir), MaxRDir(max_rdir)
509 {
510  Execute();
511 }
virtual bool Execute()

Here is the call graph for this function:

Member Function Documentation

virtual void C4ValueProviderRDir::ClearPointers ( C4Object pObj)
inlinevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 224 of file C4MeshAnimation.h.

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

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 524 of file C4MeshAnimation.cpp.

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

525 {
527  pComp->Separator();
528  pComp->Value(Object);
529  pComp->Separator();
530  pComp->Value(Begin);
531  pComp->Separator();
532  pComp->Value(End);
533  pComp->Separator();
534  pComp->Value(MaxRDir);
535 }
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:129
void Value(const T &rStruct)
Definition: StdCompiler.h:170
void CompileFunc(C4Real &rValue, StdCompiler *pComp)
Definition: C4Real.cpp:9033

Here is the call graph for this function:

virtual void C4ValueProviderRDir::DenumeratePointers ( )
inlinevirtual

Reimplemented from StdMeshInstance::SerializableValueProvider.

Definition at line 223 of file C4MeshAnimation.h.

References C4ObjectPtr::DenumeratePointers().

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

Here is the call graph for this function:

bool C4ValueProviderRDir::Execute ( )
virtual

Implements StdMeshInstanceValueProvider.

Definition at line 513 of file C4MeshAnimation.cpp.

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

Referenced by C4ValueProviderRDir().

514 {
515  // Object might have been removed
516  if(!Object) return false;
517 
518  C4Real val = (Object->rdir - MinRDir) / (MaxRDir - MinRDir);
519 
520  Value = Begin + (End - Begin) * Clamp<C4Real>(val, itofix(0), itofix(1));
521  return true;
522 }
C4Real rdir
Definition: C4Object.h:126
Definition: C4Real.h:58
C4Fixed itofix(int32_t x)
Definition: C4Real.h:261

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: