TP_MasterSystem Class Reference

#include <c4d_particles.h>

Inheritance diagram for TP_MasterSystem:

详细描述

The master system is the main Thinking Particles engine class. There can only be one master system per document. This is the easiest way to get it:

TP_MasterSystem * GetTpMasterSystem( BaseDocument * doc) { if (!doc) return nullptr ;
BaseSceneHook * hook = doc-> FindSceneHook ( ID_THINKINGPARTICLES ); if (!hook || hook-> GetType () != ID_THINKINGPARTICLES ) return nullptr ; return static_cast< TP_MasterSystem * > (hook); }

私有成员函数

  TP_MasterSystem ()
  ~TP_MasterSystem ()

Particle/Particles

Int32   AllocParticle (void)
Int32   AllocParticles ( Int32 num, Int32 *ids)
void  FreeParticle ( Int32 pid)
void  FreeAllParticles (void)
Int32   NumParticles (void)

Particle Group

TP_PGroup AllocParticleGroup (void)
void  FreeParticleGroup ( TP_PGroup *&group)
Bool   SetPGroupHierarchy ( TP_PGroup *parent, TP_PGroup *group, TP_InsertMode mode)
Int32   GetParticleGroups ( TP_PGroup *ingroup, TP_PGroupArray *gtab, TP_GetPGroupMode 模式, Bool subgroups=true)
Int32   GetGroupParticleCount ( TP_PGroup *ingroup, Bool subgroups=true)
BaseObject GetVirtualObjects ( TP_PGroup *ingroup, Bool inRender=true, Bool subgroups=true, HierarchyHelp *hh=nullptr)
BaseContainer GetGroupInfo ( TP_PGroup *group)
TP_PGroup GetGroupFromInfo ( BaseContainer *info)
Bool   UpdateGroup ( TP_PGroup *group, const BaseTime &timeDelta)

Particle Information/Bits

Bool   Alive ( Int32 pid)
Bool   IsBorn ( Int32 pid)
Bool   IsDie ( Int32 pid)
Bool   EntersGroup ( Int32 pid)
TP_PGroup Group ( Int32 pid)
向量   位置 ( Int32 pid)
向量   Velocity ( Int32 pid)
Float   Mass ( Int32 pid)
TP_Spin   Spin ( Int32 pid)
Float   Size ( Int32 pid)
向量   比例 ( Int32 pid)
BaseTime   Age ( Int32 pid)
BaseTime   Life ( Int32 pid)
矩阵   Alignment ( Int32 pid)
Int32   Randomseed ( Int32 pid)
TP_PShapePtr   形状 ( Int32 pid)
矩阵   变换 ( Int32 pid)
UInt16   Flags ( Int32 pid)
Float   DTFactor ( Int32 pid)

Set Particle Information/Bits

void  SetPosition ( Int32 pid, const 向量 &p)
void  SetVelocity ( Int32 pid, const 向量 &p)
void  SetMass ( Int32 pid, Float mass)
void  SetSpin ( Int32 pid, const TP_Spin &spin)
void  SetAge ( Int32 pid, const BaseTime &age)
void  SetLife ( Int32 pid, const BaseTime &life)
void  SetGroup ( Int32 pid, TP_PGroup *group)
void  SetSize ( Int32 pid, Float size)
void  SetScale ( Int32 pid, const 向量 &scale)
void  SetAlignment ( Int32 pid, const 矩阵 &align)
void  SetRandomseed ( Int32 pid, Int32 seed)
void  SetShape ( Int32 pid, const TP_PShapePtr &shape, Bool deleteold=true)
void  SetCollision ( Int32 pid, Int32 collision)
void  SetDTFactor ( Int32 pid, Float dt)

Particle Data Channels

Bool   AddDataChannel ( GvDataID type, const maxon::String &str)
Bool   RemoveDataChannel ( Int32 chan)
Int32   NumDataChannels (void)
GvDataID   DataChannelType ( Int32 chan)
String   DataChannelName ( Int32 chan)
Int32   DataChannelUniqueID ( Int32 chan)
Int32   DataChannelID ( Int32 unique_id)
Bool   SetData ( Int32 pid, Int32 chan, void *data, GvValueID type)
Bool   GetData ( Int32 pid, Int32 chan, void *data, GvValueID type)
Bool   SetDataFromPort ( Int32 pid, Int32 chan, GvPort *p, GvRun *r)
Bool   SetDataToPort ( Int32 pid, Int32 chan, GvPort *p, GvRun *r)
BaseContainer GetDataChannelInfo ( Int32 chan)
Int32   GetDataChannelFromInfo ( BaseContainer *info)

Callbacks

void  Reg_FreeParticle_CB ( TP_FreeParticle_CB *cb)
void  UReg_FreeParticle_CB ( TP_FreeParticle_CB *cb)
void  Reg_DeletePShape_CB ( TP_FreePShape_CB *cb)
void  UReg_DeletePShape_CB ( TP_FreePShape_CB *cb)

Operator Link Table

Int32   GetOperatorID ( GvNode *op)
GvOperatorData GetOperator ( Int32 id)

Dirty

UInt32   GetDirty (void) const
void  SetDirty (void)

Collision

Bool   CheckCollision ( Int32 collision, Int32 pid, Float t, 向量 &pos, 向量 &vel, TP_Spin &spin, Float dt, Float &ct)

Particle Shape

TP_PShapePtr   GetShapeClone (const TP_PShapePtr &shape, Int32 pid, COPYFLAGS flags, AliasTrans *trn)
TP_PShapePtr   GetShape (const TP_PShapePtr &shape, Int32 pid, Int32 owner_id)
BaseObject GetShapeVirtualObjects (const TP_PShapePtr &shape, Int32 pid, BaseDocument *doc, HierarchyHelp *hh)
Float   GetShapeScale (const TP_PShapePtr &shape, Int32 pid)
void  FreeShape ( TP_PShapePtr &shape, Int32 pid)

Collider Cache

GeColliderCache ColliderCache ( Int32 pid)

Color Property

Vector32   颜色 ( Int32 pid)
void  SetColor ( Int32 pid, const Vector32 &color)

Additional Inherited Members

-  Public Member Functions inherited from BaseSceneHook
Bool   InitDisplayControl ( BaseDocument *doc, BaseDraw *bd, const AtomArray *active)
void  FreeDisplayControl ()
Bool   DisplayControl ( BaseDocument *doc, BaseObject *op, BaseObject *chainstart, BaseDraw *bd, BaseDrawHelp *bh, ControlDisplayStruct &cds) const
void  Draw ( BaseDocument *doc, BaseDraw *bd, BaseDrawHelp *bh, BaseThread *bt, SCENEHOOKDRAW flags)
-  Public Member Functions inherited from BaseList2D
const Char GetViewportRenderId ( VIEWPORT_RENDER_ID typeId) const
BaseList2D GetNext ()
BaseList2D GetPred ()
void  SetBit ( Int32 mask)
Bool   GetBit ( Int32 mask) const
void  DelBit ( Int32 mask)
void  ToggleBit ( Int32 mask)
Int32   GetAllBits () const
void  SetAllBits ( Int32 bits)
void  SetBitEx ( Int32 mask, Int32 flags)
BaseContainer   GetData ()
void  SetData (const BaseContainer &bc, Bool add=true)
const BaseContainer GetDataInstance () const
BaseContainer GetDataInstance ()
const BaseContainer GetDataInstanceRef () const
BaseContainer GetDataInstanceRef ()
String   GetName () const
void  SetName (const maxon::String &name)
String   GetBubbleHelp ()
Bool   TransferGoal ( BaseList2D *dst, Bool undolink)
Bool   TransferMarker ( BaseList2D *dst) const
Bool   比例 ( Float scale)
Bool   编辑 ()
void  GetIcon ( IconData *dat)
GeListHead GetNLARoot ()
BaseList2D AnimationLayerRemap ( BaseObject **layer=nullptr)
String   GetTypeName ()
BaseList2D GetMain () const
void  InsertTrackSorted ( CTrack *track)
Bool   AddEventNotification ( BaseList2D *bl, NOTIFY_EVENT eventid, NOTIFY_EVENT_FLAG flags, const BaseContainer *data)
Bool   RemoveEventNotification ( BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
Bool   FindEventNotification ( BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
Bool   SetDescIDState (const DescID &id, DESCIDSTATE descidstate)
DESCIDSTATE   GetDescIDState (const DescID &id, Bool tolerant) const
GeListHead GetOverrideRoot ()
BaseOverride GetFirstOverride ()
GeListHead GetShaderRepositoryRoot ()
GeListHead GetHiddenShaderRoot ()
maxon::NimbusInterface *  GetNimbusRef (const maxon::Id &spaceId) const
maxon::Result < maxon::NimbusInterface * >  GetOrCreateNimbusRef (const maxon::Id &spaceId)
void  RemoveNimbusRef (const maxon::Id &spaceId)
maxon::Result < maxon::HashMap < maxon::Id , maxon::ForwardRef < maxon::NimbusRef > > >  GetAllNimbusRefs () const
Bool   IsNodeBased () const
void  GetMarkerStampEx ( UInt32 *l1, UInt32 *l2)
const GeMarker GetMarker () const
void  SetMarker (const GeMarker &m)
Bool   AddUniqueID ( Int32 appid, const Char *const mem, Int bytes)
Bool   FindUniqueID ( Int32 appid, const Char *&mem, Int &bytes) const
Int32   GetUniqueIDCount () const
Bool   GetUniqueIDIndex ( Int32 idx, Int32 &id, const Char *&mem, Int &bytes) const
Bool   SetAnimatedParameter ( CTrack *track, const DescID &id, const GeData &t_data1, const GeData &t_data2, Float mix, DESCFLAGS_SET flags)
Bool   GetAnimatedParameter (const DescID &id, GeData &t_data1, GeData &t_data2, Float &mix, DESCFLAGS_GET flags)
BaseShader GetFirstShader () const
void  InsertShader ( BaseShader *shader, BaseShader *pred=nullptr)
void  ClearKeyframeSelection ()
Bool   FindKeyframeSelection (const DescID &id)
Bool   SetKeyframeSelection (const DescID &id, Bool selection)
Bool   KeyframeSelectionContent ()
LayerObject GetLayerObject ( BaseDocument *doc)
Bool   SetLayerObject ( LayerObject *layer)
const LayerData GetLayerData ( BaseDocument *doc, Bool rawdata=false)
Bool   SetLayerData ( BaseDocument *doc, const LayerData &data)
GeListHead GetCTrackRoot ()
CTrack GetFirstCTrack ()
CTrack FindCTrack (const DescID &id)
-  Public Member Functions inherited from GeListNode
GeListNode GetNext ()
GeListNode GetPred ()
GeListNode GetDown ()
GeListNode GetUp ()
GeListNode GetDownLast ()
void  InsertBefore ( GeListNode *bl)
void  InsertAfter ( GeListNode *bl)
void  InsertUnder ( GeListNode *bl)
void  InsertUnderLast ( GeListNode *bl)
void  移除 ()
GeListHead GetListHead ()
Int32   GetNodeID ( Int32 index=0) const
template<typename CAST >
const CAST *  GetNodeData ( Int32 index=0) const
template<typename CAST >
CAST *  GetNodeData ( Int32 index=0)
void  SetCustomData ( GeListNode *node)
GeListNode GetCustomData ()
BaseDocument GetDocument ()
Int32   GetBranchInfo ( BranchInfo *info, Int32 max, GETBRANCHINFO flags)
Bool   IsDocumentRelated ()
Int32   GetInfo ()
Bool   GetNBit ( NBIT bit) const
UInt32   GetNBitMask ( Int32 index) const
Bool   ChangeNBit ( NBIT bit, NBITCONTROL bitmode)
-  Public Member Functions inherited from C4DAtom
Int32   GetType () const
Int32   GetRealType () const
Int32   GetDiskType () const
Bool   IsInstanceOf ( Int32 id) const
Int32   GetClassification () const
Bool   消息 ( Int32 type, void *data=nullptr)
Bool   MultiMessage ( MULTIMSG_ROUTE flags, Int32 type, void *data)
C4DAtom GetClone ( COPYFLAGS flags, AliasTrans *trn)
Bool   CopyTo ( C4DAtom *dst, COPYFLAGS flags, AliasTrans *trn)
Bool   读取 ( HyperFile *hf, Int32 id, Int32 level)
Bool   Write ( HyperFile *hf)
Bool   ReadObject ( HyperFile *hf, Bool readheader)
Bool   WriteObject ( HyperFile *hf)
Bool   GetDescription ( 描述 *description, DESCFLAGS_DESC flags)
Bool   GetParameter (const DescID &id, GeData &t_data, DESCFLAGS_GET flags)
Bool   SetParameter (const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
DynamicDescription GetDynamicDescription ()
Bool   GetEnabling (const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
Bool   TranslateDescID (const DescID &id, DescID &res_id, C4DAtom *&res_at)
UInt32   GetDirty ( DIRTYFLAGS flags) const
void  SetDirty ( DIRTYFLAGS flags)
UInt32   GetHDirty ( HDIRTYFLAGS mask) const
void  SetHDirty ( HDIRTYFLAGS mask)
-  Static Public Member Functions inherited from BaseList2D
static BaseList2D Alloc ( Int32 type)
static void  Free ( BaseList2D *&bl)
-  Static Public Attributes inherited from BaseList2D
static const Int32   SETBIT_FLAG_NODIRTY
static const Int32   SETBIT_FLAG_REMOVE

构造函数 & 析构函数文档编制

◆  TP_MasterSystem()

TP_MasterSystem () private

◆  ~TP_MasterSystem()

~ TP_MasterSystem () private

成员函数文档编制

◆  AllocParticle()

Int32 AllocParticle ( void  )

Allocates a particle.

返回
The particle ID of the allocated particle, or NOTOK if the allocation failed.

◆  AllocParticles()

Int32 AllocParticles ( Int32   num ,
Int32 ids  
)

Allocates num particles and stores their particles IDs in the ids array.

参数
[in] num The number of particles to allocate.
[out] ids An array of num Int32 elements. Filled with the allocated particle IDs. The caller owns the pointed array.
返回
The number of particles allocated, or NOTOK if the allocation failed.

◆  FreeParticle()

void FreeParticle ( Int32   pid )

Frees a particle.

注意
Normally this should not be used. Instead SetLife() should be uses with a negative time, so that the particle in question dies immediately.
参数
[in] pid The particle ID of the particle to free: 0 <= pid < NumParticles()

◆  FreeAllParticles()

void FreeAllParticles ( void  )

Frees all particles.

注意
Normally this should not be used. Instead SetLife() should be uses with a negative time, so that the particles dies immediately.

◆  NumParticles()

Int32 NumParticles ( void  )

Retrieves the number of allocated particles. All particles IDs are less than this value.

返回
The number of particles.

◆  AllocParticleGroup()

TP_PGroup * AllocParticleGroup ( void  )

Allocates a new particle group. Must be freed with FreeParticleGroup() , or inserted into the list with SetPGroupHierarchy() .

返回
The allocate particle group. The caller owns the pointed TP_PGroup .

◆  FreeParticleGroup()

void FreeParticleGroup ( TP_PGroup *&  group )

Frees a particle group, removing it from the list.

参数
[in,out] group The group to free. Set to nullptr afterwards.

◆  SetPGroupHierarchy()

Bool SetPGroupHierarchy ( TP_PGroup parent ,
TP_PGroup group ,
TP_InsertMode   mode  
)

Performs a hierarchy action on a particle group.

参数
[in] parent The parent parameter. The caller owns the pointed TP_PGroup .
[in] group The group to act on. The caller owns the pointed TP_PGroup .
[in] mode The hierarchy action: TP_InsertMode
返回
true if successful, otherwise false .

◆  GetParticleGroups()

Int32 GetParticleGroups ( TP_PGroup ingroup ,
TP_PGroupArray gtab ,
TP_GetPGroupMode   mode ,
Bool   subgroups = true  
)

Returns the particle groups in ingroup , specified by mode , into the gtab 列表。
范例:

PluginSceneHook* hook = doc-> FindSceneHook ( ID_THINKINGPARTICLES ); if (hook && hook->GetType() == ID_THINKINGPARTICLES ) { TP_MasterSystem *tpm = ( TP_MasterSystem *)hook; TP_PGroupArray groups; Int32 gcnt = tpm-> GetParticleGroups ( nullptr , &groups, TP_GETPGROUP_ALL , false ); // For subgroups //Int32 gcnt = tpm->GetParticleGroups(nullptr,&groups, TP_GETPGROUP_ALL, true); TP_PGroup *grp = ( TP_PGroup *)groups. GetIndex (0); // grp is the "All" group

//To iterate //for (Int32 i=0; i<gcnt; i++) //{ // TP_PGroup *grp = (TP_PGroup*)groups.GetIndex(i); //} }

参数
[in] ingroup The in-group parameter. The caller owns the pointed TP_PGroup .
[out] gtab The specified groups are added to this list. The caller owns the pointed TP_PGroup .
[in] mode The mode: TP_GetPGroupMode
[in] subgroups true sub-groups are included.
返回
The number of groups added to gtab .

◆  GetGroupParticleCount()

Int32 GetGroupParticleCount ( TP_PGroup ingroup ,
Bool   subgroups = true  
)

Calculates the number of particles in ingroup .

参数
[in] ingroup The in-group parameter. The caller owns the pointed TP_PGroup .
[in] subgroups true sub-groups are included.
返回
The number of particles in the specified group.

◆  GetVirtualObjects()

BaseObject * GetVirtualObjects ( TP_PGroup ingroup ,
Bool   inRender = true ,
Bool   subgroups = true ,
HierarchyHelp hh = nullptr  
)

Creates the virtual object hierarchy for a particle group, i.e. an object group containing all particles. Used by the ParticleGeometry object.

参数
[in] ingroup The in-group parameter. The caller owns the pointed TP_PGroup .
[in] inRender true if this is for rendering, otherwise the objects are built for the editor view.
[in] subgroups true sub-groups are included.
[in] hh The hierarchy helper for the virtual object generation. The caller owns the pointed HierarchyHelp .
返回
The virtual object, or nullptr if there was an error.

◆  GetGroupInfo()

BaseContainer * GetGroupInfo ( TP_PGroup group )

Retrieves the group information for a group .

参数
[in] group The group to get the information for. The caller owns the pointed TP_PGroup .
返回
The group information for group. The caller owns the pointed TP_PGroupInfo .

◆  GetGroupFromInfo()

TP_PGroup * GetGroupFromInfo ( BaseContainer info )

Retrieves a group from the information in info .

参数
[in] info The group information to search for. The caller owns the pointed TP_PGroupInfo .
返回
The retrieved group, or nullptr if no group matched. The master system owns the pointed TP_PGroup .

◆  UpdateGroup()

Bool UpdateGroup ( TP_PGroup group ,
const BaseTime timeDelta  
)

Updates a group at a given time difference since the last update. Use a default timeDelta of 0 to update at the current time.

由于
R16.050
参数
[in] group The group to update. The caller owns the pointed TP_PGroup .
[in] timeDelta The time difference since the last update.
返回
true if the update was done successfully, otherwise false .

◆  Alive()

Bool Alive ( Int32   pid )

Retrieves the alive bit of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
true if the particle is alive, otherwise false .

◆  IsBorn()

Bool IsBorn ( Int32   pid )

Retrieves the is-born bit of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
true if the particle was just born, otherwise false .

◆  IsDie()

Bool IsDie ( Int32   pid )

Retrieves the is-die bit of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
true if the particle just died, otherwise false .

◆  EntersGroup()

Bool EntersGroup ( Int32   pid )

Retrieves the enters-group bit of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
true if the particle just entered a group, otherwise false .

◆  Group()

TP_PGroup * Group ( Int32   pid )

Retrieves the group of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The group that the particle currently is in. The master system owns the pointed TP_PGroup .

◆  Position()

向量 位置 ( Int32   pid )

Retrieves the position of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle position.

◆  Velocity()

向量 Velocity ( Int32   pid )

Retrieves the velocity of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle velocity.

◆  Mass()

Float Mass ( Int32   pid )

Retrieves the mass of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle mass.

◆  Spin()

TP_Spin Spin ( Int32   pid )

Retrieves the spin of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle spin.

◆  Size()

Float Size ( Int32   pid )

Retrieves the size of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle size.

◆  Scale()

向量 比例 ( Int32   pid )

Retrieves the scale of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle scale.

◆  Age()

BaseTime Age ( Int32   pid )

Retrieves the age of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle age.

◆  Life()

BaseTime Life ( Int32   pid )

Retrieves the lifetime of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle lifetime.

◆  Alignment()

矩阵 Alignment ( Int32   pid )

Retrieves the alignment matrix of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle alignment matrix.

◆  Randomseed()

Int32 Randomseed ( Int32   pid )

Retrieves the random seed of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle random seed.

◆  Shape()

TP_PShapePtr 形状 ( Int32   pid )

Retrieves the shape of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle shape. The master system owns the pointed TP_PShapePtr .

◆  Transform()

矩阵 变换 ( Int32   pid )

Retrieves the transformation matrix of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle transformation matrix.

◆  Flags()

UInt16 Flags ( Int32   pid )

Retrieves the flags of a particle.

注意
These returned flags are private. Use the functions like Alive() instead.
参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle flags.

◆  DTFactor()

Float DTFactor ( Int32   pid )

Retrieves the delta time factor of a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle delta time factor.

◆  SetPosition()

void SetPosition ( Int32   pid ,
const 向量 p  
)

Sets the position for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] p The new particle position.

◆  SetVelocity()

void SetVelocity ( Int32   pid ,
const 向量 p  
)

Sets the velocity for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] p The new particle velocity.

◆  SetMass()

void SetMass ( Int32   pid ,
Float   mass  
)

Sets the mass for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] mass The new particle mass.

◆  SetSpin()

void SetSpin ( Int32   pid ,
const TP_Spin spin  
)

Sets the spin for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] spin The new particle spin.

◆  SetAge()

void SetAge ( Int32   pid ,
const BaseTime age  
)

Sets the age for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] age The new particle age.

◆  SetLife()

void SetLife ( Int32   pid ,
const BaseTime life  
)

Sets the lifetime for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] life The new particle lifetime.

◆  SetGroup()

void SetGroup ( Int32   pid ,
TP_PGroup group  
)

Inserts a particle into another group.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] group The group to place the particle in. The pointed group must belong to this master system.

◆  SetSize()

void SetSize ( Int32   pid ,
Float   size  
)

Sets the size for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] size The new particle size.

◆  SetScale()

void SetScale ( Int32   pid ,
const 向量 scale  
)

Sets the scale for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] scale The new particle scale.

◆  SetAlignment()

void SetAlignment ( Int32   pid ,
const 矩阵 align  
)

Sets the alignment matrix for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] align The new particle alignment matrix.

◆  SetRandomseed()

void SetRandomseed ( Int32   pid ,
Int32   seed  
)

Sets the random seed for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] seed The new particle random seed.

◆  SetShape()

void SetShape ( Int32   pid ,
const TP_PShapePtr shape ,
Bool   deleteold = true  
)

Sets the shape for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] shape The new particle shape.
TP_PShapeI::owner_id should be set to GetOperatorID() for the node responsible for the shape handling.
This node should be prepared to provide a TP_PShapeInterface via the TP_MSG_GET_PSHAPEINTERFACE message.
[in] deleteold true the old shape is deleted.

◆  SetCollision()

void SetCollision ( Int32   pid ,
Int32   collision  
)

Sets the collision handling information for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] collision The collision ID.
This is the GetOperatorID() for the node responsible for the collision handling.
This node should be prepared to provide a TP_CollisionInterface via the TP_MSG_GET_COLLISIONINTERFACE message.

◆  SetDTFactor()

void SetDTFactor ( Int32   pid ,
Float   dt  
)

Sets the delta time factor for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] dt The new particle delta time factor.

◆  AddDataChannel()

Bool AddDataChannel ( GvDataID   type ,
const maxon::String str  
)

Adds a data channel.

参数
[in] type The channel data type: GvDataID
[in] str The channel name.
返回
true if successful, otherwise false .

◆  RemoveDataChannel()

Bool RemoveDataChannel ( Int32   chan )

Removes a data channel.

参数
[in] chan The channel index: 0 <= chan < NumDataChannels()
返回
true if successful, otherwise false .

◆  NumDataChannels()

Int32 NumDataChannels ( void  )

Retrieves the data channel count.

返回
The number of data channels.

◆  DataChannelType()

GvDataID DataChannelType ( Int32   chan )

Retrieves the data type of a data channel.

参数
[in] chan The channel index: 0 <= chan < NumDataChannels()
返回
The data type of channel chan .

◆  DataChannelName()

String DataChannelName ( Int32   chan )

Retrieves the name of a data channel.

参数
[in] chan The channel index: 0 <= chan < NumDataChannels()
返回
The data channel name.

◆  DataChannelUniqueID()

Int32 DataChannelUniqueID ( Int32   chan )

Retrieves a unique ID for a data channel that is independent of its index.

参数
[in] chan The channel index: 0 <= chan < NumDataChannels()
返回
A unique ID for channel chan .

◆  DataChannelID()

Int32 DataChannelID ( Int32   unique_id )

Retrieves the index of a data channel from its unique ID.

参数
[in] unique_id The unique channel ID.
返回
The data channel index.

◆  SetData()

Bool SetData ( Int32   pid ,
Int32   chan ,
void *  data ,
GvValueID   type  
)

Sets the data channel for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] chan The channel index: 0 <= chan < NumDataChannels()
[in] data The data to set. Points to GV data. The layout of the pointed data is determined by type .
[in] type Determines the type of data .
返回
true if successful, otherwise false .

◆  GetData()

Bool GetData ( Int32   pid ,
Int32   chan ,
void *  data ,
GvValueID   type  
)

Retrieves the data channel for a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] chan The channel index: 0 <= chan < NumDataChannels()
[out] data Filled with the retrieved data. Points to GV data. The layout of the pointed data is determined by type .
[in] type Determines the type of data .
返回
true if successful, otherwise false .

◆  SetDataFromPort()

Bool SetDataFromPort ( Int32   pid ,
Int32   chan ,
GvPort p ,
GvRun r  
)

Sets the data channel for a particle, getting the data from a GV port.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] chan The channel index: 0 <= chan < NumDataChannels()
[in] p The port with the data to set. The caller owns the pointed GvPort .
[in] r The run helper. The caller owns the pointed GvRun .
返回
true if successful, otherwise false .

◆  SetDataToPort()

Bool SetDataToPort ( Int32   pid ,
Int32   chan ,
GvPort p ,
GvRun r  
)

Retrieves the data channel for a particle, storing the data in a GV port.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] chan The channel index: 0 <= chan < NumDataChannels()
[out] p The retrieved data is set in this port. The caller owns the pointed GvPort .
[in] r The run helper. The caller owns the pointed GvRun .
返回
true if successful, otherwise false .

◆  GetDataChannelInfo()

BaseContainer * GetDataChannelInfo ( Int32   chan )

Retrieves the channel information for a data channel.

警告
The returned object needs to be free with DeleteObj (info) afterwards.
参数
[in] chan The channel index: 0 <= chan < NumDataChannels()
返回
The channel information for chan. The caller owns the pointed TP_DataChannelInfo .

◆  GetDataChannelFromInfo()

Int32 GetDataChannelFromInfo ( BaseContainer info )

Retrieves a data channel index from the information in info .

参数
[in] info The information to search for. The caller owns the pointed TP_DataChannelInfo .
返回
The retrieved channel index, or NOTOK if no channel matched.

◆  Reg_FreeParticle_CB()

void Reg_FreeParticle_CB ( TP_FreeParticle_CB cb )

Registers a free-particle callback.

参数
[in] cb The callback to register.

◆  UReg_FreeParticle_CB()

void UReg_FreeParticle_CB ( TP_FreeParticle_CB cb )

Unregisters a free-particle callback.

参数
[in] cb The callback to unregister.

◆  Reg_DeletePShape_CB()

void Reg_DeletePShape_CB ( TP_FreePShape_CB cb )

Registers a delete-shape callback.

参数
[in] cb The callback to register.

◆  UReg_DeletePShape_CB()

void UReg_DeletePShape_CB ( TP_FreePShape_CB cb )

Unregisters a delete-shape callback.

参数
[in] cb The callback to unregister.

◆  GetOperatorID()

Int32 GetOperatorID ( GvNode op )

Retrieves an ID for op that can later be used with GetOperator() to get op back.

警告
The ID is only valid during a limited time.
参数
[in] op A node. The caller owns the pointed node.
返回
An operator ID for op .

◆  GetOperator()

GvOperatorData * GetOperator ( Int32   id )

Retrieves the operator for an ID previously acquired with GetOperatorID() .

参数
[in] id The operator ID, as returned by GetOperatorID() .
返回
The retrieved operator, or nullptr . The GV world owns the pointed object.

◆  GetDirty()

UInt32 GetDirty ( void  ) const

A dirty counter for the master system. This can be used to see if anything has changed. Use SetDirty() to increment the counter.

返回
The dirty counter, incremented when something changes in the system.

◆  SetDirty()

void SetDirty ( void  )

Increments the dirty counter, i.e. tells anyone using GetDirty() that something has changed.

注意
This has to be used whenever an operator affects particle shapes, like the ObjectShape operator does.

◆  CheckCollision()

Bool CheckCollision ( Int32   collision ,
Int32   pid ,
Float   t ,
向量 pos ,
向量 vel ,
TP_Spin spin ,
Float   dt ,
Float ct  
)

Finds the node responsible for collision , the one that called SetCollision() , and tells it to evaluate the passed collision parameters.

注意
Normally Thinking Particles evaluates this function automatically for registered collisions.
参数
[in] collision The collision ID. This is GetOperatorID() for the node responsible for the collision.
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] t Time to evaluate the collision at. Collisions are detected between t - dt and t .
[in] pos Assigned the new position of the object if there is a collision.
[out] vel Assigned the new velocity of the object if there is a collision.
[out] spin Assigned the new spin of the object if there is a collision.
[in] dt The time since the last evaluation, i.e. the time to look backwards for collisions.
[in] ct The collision time, if there was a collision. This is generally less than t .
返回
true if there was a collision, otherwise false .

◆  GetShapeClone()

TP_PShapePtr GetShapeClone ( const TP_PShapePtr shape ,
Int32   pid ,
COPYFLAGS   flags ,
AliasTrans trn  
)

Finds the node responsible for shape , as specified by TP_PShapeI::owner_id , and tells it to return a clone of shape .

注意
Normally Thinking Particles evaluates this function automatically for registered shapes.
警告
The returned shape must be free with FreeShape() afterwards.
参数
[in] shape The particle shape. The caller owns the pointed shape.
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] flags The flags: COPYFLAGS
[in] trn An alias translator for the operation. Can be nullptr . The caller owns the pointed AliasTrans .
返回
The particle shape pointer structure of the cloned particle shape. The caller owns the pointed shape.

◆  GetShape()

TP_PShapePtr GetShape ( const TP_PShapePtr shape ,
Int32   pid ,
Int32   owner_id  
)

Finds the node responsible for shape , as specified by TP_PShapeI::owner_id , and tells it to return the shape associated with shape . (Normally this is the same object.)

注意
Normally Thinking Particles evaluates this function automatically for registered shapes.
参数
[in] shape The particle shape. The caller owns the pointed shape.
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] owner_id The owner ID.
返回
The shape. The shape handler owns the pointed shape.

◆  GetShapeVirtualObjects()

BaseObject * GetShapeVirtualObjects ( const TP_PShapePtr shape ,
Int32   pid ,
BaseDocument doc ,
HierarchyHelp hh  
)

Finds the node responsible for shape , as specified by TP_PShapeI::owner_id , and tells it to return a BaseObject shape for shape .

注意
Normally Thinking Particles evaluates this function automatically for registered shapes.
参数
[in] shape The particle shape. The caller owns the pointed shape.
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] doc The current document. The caller owns the pointed BaseDocument .
[in] hh A hierarchy helper for the operation. The caller owns the pointed HierarchyHelp .
返回
The particle shape object. The particle shape handler owns the pointed object.

◆  GetShapeScale()

Float GetShapeScale ( const TP_PShapePtr shape ,
Int32   pid  
)

Finds the node responsible for shape , as specified by TP_PShapeI::owner_id , and tells it to return the scale of shape .

注意
Normally Thinking Particles evaluates this function automatically for registered shapes.
参数
[in] shape The particle shape. The caller owns the pointed shape.
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The shape scale.

◆  FreeShape()

void FreeShape ( TP_PShapePtr shape ,
Int32   pid  
)

Finds the node responsible for shape , as specified by TP_PShapeI::owner_id , and tells it to free shape .

注意
Normally Thinking Particles evaluates this function automatically for registered shapes.
参数
[in] shape The particle shape. The caller owns the pointed shape.
[in] pid The particle ID: 0 <= pid < NumParticles()

◆  ColliderCache()

GeColliderCache * ColliderCache ( Int32   pid )

Retrieves a collider cache for the shape associated with a particle.

参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The collider cache, or nullptr . The system owns the pointed collider cache.

◆  Color()

Vector32 颜色 ( Int32   pid )

Retrieves the color for a particle.

由于
R16.038
参数
[in] pid The particle ID: 0 <= pid < NumParticles()
返回
The particle color.

◆  SetColor()

void SetColor ( Int32   pid ,
const Vector32 color  
)

Sets the color for a particle.

由于
R16.038
参数
[in] pid The particle ID: 0 <= pid < NumParticles()
[in] color The particle color.
ID_THINKINGPARTICLES
#define ID_THINKINGPARTICLES
Thinking Particles scene hook ID.
定义: c4d_particles.h:26
TP_MasterSystem::GetParticleGroups
Int32 GetParticleGroups(TP_PGroup *ingroup, TP_PGroupArray *gtab, TP_GetPGroupMode mode, Bool subgroups=true)
定义: c4d_particles.h:835
TP_PGroupArray::GetIndex
TP_PGroup * GetIndex(Int i) const
定义: c4d_particles.h:149
BaseSceneHook
定义: c4d_basedocument.h:43
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
TP_PGroup
Represents a particle group.
定义: c4d_particles.h:1445
BaseDocument::FindSceneHook
BaseSceneHook * FindSceneHook(Int32 id) const
定义: c4d_basedocument.h:1234
TP_MasterSystem
定义: c4d_particles.h:739
TP_PGroupArray
定义: c4d_particles.h:121
C4DAtom::GetType
Int32 GetType() const
定义: c4d_baselist.h:1348
BaseDocument
定义: c4d_basedocument.h:490
TP_GETPGROUP_ALL
@ TP_GETPGROUP_ALL
All groups.
定义: c4d_particles.h:182