TP_CollisionInterface Struct Reference

#include <c4d_particles.h>

详细描述

Callback interface for nodes that register collisions.
The easiest way to create this is to implement the TP_BaseCollision class:
This class is only forward-declared in c4d_particles.h , so as long as the linker approves this is fine.
范例:

class TP_BaseCollision { public : TP_CollisionInterface ci; TP_BaseCollision () { ci. base = this ; }
Bool CheckCollision ( TP_Collision , TP_MasterSystem *msys, Int32 pid, Float t, 向量 &pos, 向量 &vel, TP_Spin &spin, Float dt, Float &ct) { // ... } };

TP_MSG_GET_COLLISIONINTERFACE message then simply set the passed TP_CollisionInterface pointer to &basecol.ci , for a global TP_BaseCollision basecol object that was previously created.
Thinking Particles will then call CheckCollision() as needed.

Public Attributes

TP_BaseCollision base
Bool (TP_BaseCollision::*  CheckCollision )( Int32 collision, TP_MasterSystem *msys, Int32 pid, Float t, 向量 &pos, 向量 &vel, TP_Spin &spin, Float dt, Float &ct)

Member Data Documentation

◆  base

TP_BaseCollision * base

Base class pointer.

◆  CheckCollision

Bool (TP_BaseCollision::* CheckCollision( Int32 collision, TP_MasterSystem *msys, Int32 pid, Float t, 向量 &pos, 向量 &vel, TP_Spin &spin, Float dt, Float &ct)

Called by Thinking Particles when a collision handle is registered with TP_MasterSystem::SetCollision() , and provided Thinking Particles with a TP_CollisionInterface TP_MSG_GET_COLLISIONINTERFACE message.
Evaluate the passed collision parameters and set the output parameters. Thinking Particles will then update the particle values.

参数
[in] collision The collision ID. This is GvNode::GetOperatorID() for the node responsible for the collision.
[in] msys The master system. The caller owns the pointed TP_MasterSystem .
[in] pid The particle ID: 0 <= pid < msys -> NumParticles()
[in] t The time to evaluate the collision at. Collisions are detected between t - dt and t t.
[out] pos Assign the new position of the object if there is a collision.
[out] vel Assign the new velocity of the object if there is a collision.
[out] spin Assign 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 Assign the collision time, if there was a collision. This will generally be less than t .
返回
true if there was a collision, otherwise false .
TP_Collision
#define TP_Collision
Collision ID.
定义: c4d_particles.h:190
TP_CollisionInterface::CheckCollision
Bool(TP_BaseCollision::* CheckCollision)(Int32 collision, TP_MasterSystem *msys, Int32 pid, Float t, Vector &pos, Vector &vel, TP_Spin &spin, Float dt, Float &ct)
定义: c4d_particles.h:238
Float
maxon::Float Float
定义: ge_sys_math.h:64
TP_CollisionInterface::base
TP_BaseCollision * base
Base class pointer.
定义: c4d_particles.h:222
TP_Spin
定义: c4d_particles.h:158
maxon::Vec3< maxon::Float64, 1 >
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
TP_CollisionInterface
定义: c4d_particles.h:220
TP_BaseCollision
定义: c4d_particles.h:196
TP_MasterSystem
定义: c4d_particles.h:739
Bool
maxon::Bool Bool
定义: ge_sys_math.h:53