本文整理汇总了C++中Modifier::ClassID方法的典型用法代码示例。如果您正苦于以下问题:C++ Modifier::ClassID方法的具体用法?C++ Modifier::ClassID怎么用?C++ Modifier::ClassID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Modifier
的用法示例。
在下文中一共展示了Modifier::ClassID方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//=================================================================
// Methods for DumpModelTEP
//
Modifier *FindPhysiqueModifier (INode *nodePtr)
{
// Get object from node. Abort if no object.
Object *ObjectPtr = nodePtr->GetObjectRef();
if (!ObjectPtr) return NULL;
// Is derived object ?
if (ObjectPtr->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
// Yes -> Cast.
IDerivedObject *DerivedObjectPtr = static_cast<IDerivedObject*>(ObjectPtr);
// Iterate over all entries of the modifier stack.
int ModStackIndex = 0;
while (ModStackIndex < DerivedObjectPtr->NumModifiers())
{
// Get current modifier.
Modifier *ModifierPtr = DerivedObjectPtr->GetModifier(ModStackIndex);
// Is this Physique ?
if (ModifierPtr->ClassID() == Class_ID( PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B) )
{
// Yes -> Exit.
return ModifierPtr;
}
// Next modifier stack entry.
ModStackIndex++;
}
}
// Not found.
return NULL;
}
示例2:
Modifier *CMaxMesh::FindSkinModifier(INode *pINode)
{
#if MAX_RELEASE >= 4000
// get the object reference of the node
Object *pObject;
pObject = pINode->GetObjectRef();
if(pObject == 0) return 0;
// loop through all derived objects
while(pObject->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
IDerivedObject *pDerivedObject;
pDerivedObject = static_cast<IDerivedObject *>(pObject);
// loop through all modifiers
int stackId;
for(stackId = 0; stackId < pDerivedObject->NumModifiers(); stackId++)
{
// get the modifier
Modifier *pModifier;
pModifier = pDerivedObject->GetModifier(stackId);
// check if we found the skin modifier
if(pModifier->ClassID() == SKIN_CLASSID) return pModifier;
}
// continue with next derived object
pObject = pDerivedObject->GetObjRef();
}
#endif
return 0;
}
示例3: while
Modifier *CMaxMesh::FindMorpherModifier(INode *pINode)
{
// get the object reference of the node
Object *pObject;
pObject = pINode->GetObjectRef();
if(pObject == 0) return 0;
// loop through all derived objects
while(pObject->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
IDerivedObject *pDerivedObject;
pDerivedObject = static_cast<IDerivedObject *>(pObject);
// loop through all modifiers
int stackId;
for(stackId = 0; stackId < pDerivedObject->NumModifiers(); stackId++)
{
// get the modifier
Modifier *pModifier;
pModifier = pDerivedObject->GetModifier(stackId);
Class_ID id = pModifier->ClassID();
char buf[512];
sprintf(buf, "node %s modifier %d class %d:%d/0x%x:0x%x\n",
pINode->GetName(), stackId, id.PartA(), id.PartB(), id.PartA(), id.PartB());
::OutputDebugStringA(buf);
// check if we found the physique modifier
if(pModifier->ClassID() == MR3_CLASS_ID)
{
::OutputDebugStringA("that was it! the morpher I was looking for!\n");
return pModifier;
}
}
// continue with next derived object
pObject = pDerivedObject->GetObjRef();
}
return 0;
}
示例4:
PaintDefromModData *PaintDeformTest::GetPMD(INode *pNode)
{
ModContext *mc = NULL;
Object* pObj = pNode->GetObjectRef();
if (!pObj) return NULL;
while (pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID && mc == NULL)
{
IDerivedObject* pDerObj = (IDerivedObject *)(pObj);
int Idx = 0;
while (Idx < pDerObj->NumModifiers())
{
// Get the modifier.
Modifier* mod = pDerObj->GetModifier(Idx);
if (mod->ClassID() == PAINTDEFORMTEST_CLASS_ID)
{
// is this the correct Physique Modifier based on index?
PaintDeformTest *pmod = (PaintDeformTest*)mod;
if (pmod == this)
{
mc = pDerObj->GetModContext(Idx);
break;
}
}
Idx++;
}
pObj = pDerObj->GetObjRef();
}
if(!mc) return NULL;
if ( !mc->localData ) return NULL;
PaintDefromModData *bmd = (PaintDefromModData *) mc->localData;
return bmd;
}
示例5: getISkinPtr
ISkin* CExporter::getISkinPtr(Object* object)
{
assert(object != NULL);
while (GEN_DERIVOB_CLASS_ID == object->SuperClassID())
{
IDerivedObject* pDerObj = static_cast<IDerivedObject*>(object);
for (int i = 0; i < pDerObj->NumModifiers(); ++i)
{
Modifier* mod = pDerObj->GetModifier(i);
if (SKIN_CLASSID == mod->ClassID())
{
return (ISkin*)(mod->GetInterface(I_SKIN));
}
}
object = pDerObj->GetObjRef();
}
return NULL;
}
示例6: HandleRagdollOnNonAccum
void HavokImport::HandleRagdollOnNonAccum(INode* accumChild, INode* ragdollParent)
{
const int MaxChar = 512;
char buffer[MaxChar];
//Fix for nonaccumNodes
//TSTR name(A2THelper(buffer, parent->GetName().c_str(), _countof(buffer)));
ragdollParent->SetName(FormatText(TEXT("Ragdoll_%s"), accumChild->GetName()));
Object *Obj = ragdollParent->GetObjectRef();
if (Obj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
while (Obj->SuperClassID() == GEN_DERIVOB_CLASS_ID) {
IDerivedObject *DerObj = static_cast<IDerivedObject *> (Obj);
const int nMods = DerObj->NumModifiers();
for (int i = 0; i < nMods; i++)
{
Modifier *Mod = DerObj->GetModifier(i);
if (Mod->ClassID() == HK_RIGIDBODY_MODIFIER_CLASS_ID)
{
ICustAttribContainer* cc = Mod->GetCustAttribContainer();
if (cc)
{
//reset
Mod->DeleteCustAttribContainer();
}
Mod->AllocCustAttribContainer();
cc = Mod->GetCustAttribContainer();
CustAttrib* c = (CustAttrib*)CreateInstance(CUST_ATTRIB_CLASS_ID, Class_ID(0x6e663460, 0x32682c72));
IParamBlock2* custModParameters = c->GetParamBlock(0);
custModParameters->SetValue(0, 0, accumChild, 0);
cc->InsertCustAttrib(0, c);
}
}
Obj = DerObj->GetObjRef();
}
}
}
示例7: while
Modifier *FindSkinModifier (INode *node)
{
Object* ObjectPtr = node->GetObjectRef();
if (!ObjectPtr) return NULL;
while (ObjectPtr->SuperClassID() == GEN_DERIVOB_CLASS_ID && ObjectPtr)
{
IDerivedObject *DerivedObjectPtr = (IDerivedObject *)(ObjectPtr);
int ModStackIndex = 0;
while (ModStackIndex < DerivedObjectPtr->NumModifiers())
{
Modifier* ModifierPtr = DerivedObjectPtr->GetModifier(ModStackIndex);
if (ModifierPtr->ClassID() == SKIN_CLASSID)
return ModifierPtr;
ModStackIndex++;
}
ObjectPtr = DerivedObjectPtr->GetObjRef();
}
return NULL;
}
示例8: ApplyModifiers
//----------------------------------------------------------------------------
void SceneBuilder::ApplyModifiers()
{
// 遍历节点使用收集的修改器,当前唯一支持的修改器是skin。
std::vector<ModifierInfo*>::iterator itI = mModifierList.begin();
for (; itI!=mModifierList.end(); itI++)
{
ModifierInfo *info = *itI;
std::vector<Modifier*>::iterator itJ = info->Modifiers.begin();
for (; itJ!=info->Modifiers.end(); itJ++)
{
Modifier *modifier = *itJ;
Class_ID id = modifier->ClassID();
if (id == SKIN_CLASSID)
{
ProcessSkin(info->Node, modifier);
}
}
}
}
示例9: GetPhysiqueModifier
// --[ Method ]---------------------------------------------------------------
//
// - Class : CStravaganzaMaxTools
//
// - prototype : Modifier* GetPhysiqueModifier(INode* pMaxNode)
//
// - Purpose : Returns the Physique modifier of a given node if present.
//
// -----------------------------------------------------------------------------
Modifier* CStravaganzaMaxTools::GetPhysiqueModifier(INode* pMaxNode)
{
Object* pMaxObject = pMaxNode->GetObjectRef();
if(!pMaxObject)
{
return NULL;
}
while(pMaxObject->SuperClassID() == GEN_DERIVOB_CLASS_ID && pMaxObject)
{
// Yes -> Cast.
IDerivedObject* pMaxDerivedObject = (IDerivedObject *)(pMaxObject);
// Iterate over all entries of the modifier stack.
int nModStackIndex = 0;
while(nModStackIndex < pMaxDerivedObject->NumModifiers())
{
// Get current modifier.
Modifier* pMaxModifier = pMaxDerivedObject->GetModifier(nModStackIndex);
// Is this Physique?
if(pMaxModifier->ClassID() == Class_ID(PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B))
{
return pMaxModifier;
}
nModStackIndex++;
}
pMaxObject = pMaxDerivedObject->GetObjRef();
}
// Not found.
return NULL;
}
示例10: Traverse
//----------------------------------------------------------------------------
bool SceneBuilder::Traverse(INode *maxNode, PX2::Node *relatParent)
{
// movbale对应maxNode的父节点
bool isHasSkin = false;
// Modifier
if (mSettings->IncludeModifiers)
{
ModifierInfo *modInfo = new0 ModifierInfo;
CollectModifiers(maxNode, modInfo->Modifiers);
if (modInfo->Modifiers.empty())
{
delete0(modInfo);
}
else
{
modInfo->Node = maxNode;
mModifierList.push_back(modInfo);
for (int i=0; i<(int)modInfo->Modifiers.size(); i++)
{
Modifier *modifier = modInfo->Modifiers[i];
Class_ID id = modifier->ClassID();
if (id == SKIN_CLASSID ||
id == Class_ID(PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B))
{
isHasSkin = true;
}
}
}
}
// Node
const char *nodeName = maxNode->GetName();
if(stricmp(nodeName, "PHYSICSDATA") == 0)
{
}
else if(stricmp(nodeName, "PORTALDATA") == 0)
{
}
PX2::Movable *child = 0;
ObjectState objectState = maxNode->EvalWorldState(mTimeStart);
bool supported = true;
// Object
if (objectState.obj)
{
switch (objectState.obj->SuperClassID())
{
case GEOMOBJECT_CLASS_ID:
if (IsNodeRenderable(maxNode, objectState.obj))
child = BuildGeometry(maxNode, relatParent, isHasSkin);
else
child = BuildNode(maxNode, relatParent);
break;
case CAMERA_CLASS_ID:
// ToDo
break;
case LIGHT_CLASS_ID:
if (mSettings->IncludeLights && !maxNode->IsHidden())
{
BuildLight(maxNode, relatParent);
}
break;
case HELPER_CLASS_ID:
//supported = false;
child = BuildNode(maxNode, relatParent);
break;
default:
assertion(false, "Some object type not supportted.");
supported = false;
break;
}
}
// Keyframe
if (child)
{
if (mSettings->IncludeKeyFrames)
BuildKeyFrameController(maxNode, child);
else
BuildFrameController(maxNode, child);
}
// Child
int numChildren = maxNode->NumberOfChildren();
if (numChildren == 0)
return true;
PX2::Node *childNode = 0;
childNode = PX2::DynamicCast<PX2::Node>(child);
if (childNode == 0)
return true;
for (int i=0; i<numChildren; i++)
//.........这里部分代码省略.........
示例11: extractTriangleGeometry
//.........这里部分代码省略.........
require( vpoly );
require( vpoly->index() >= 0 && vpoly->index() < mesh->getNumFaces() );
Face& vface = mesh->faces[ vpoly->index() ];
if ( 0 != (face.smGroup & vface.smGroup) || poly == vpoly )
{
Vector3 vpolyn;
vpoly->getNormal( &vpolyn.x, &vpolyn.y, &vpolyn.z );
vn += vpolyn;
}
}
// normalize
float lensqr = vn.lengthSquared();
if ( lensqr > Float::MIN_VALUE )
vn *= 1.f / Math::sqrt(lensqr);
else
vn = Vector3(0,0,0);
vmad->addValue( vert->index(), poly->index(), vn.begin(), 3 );
}
}
// re-export mesh points in non-deformed pose if Skin modifier present
// NOTE: 3ds Mesh must not be used after this, because collapsing can invalidate it
if ( skin )
{
// evaluate derived object before Skin modifier
TimeValue time = 0;
bool evalNext = false;
bool evalDone = false;
::ObjectState os;
::Object* obj = node->GetObjectRef();
while ( obj->SuperClassID() == GEN_DERIVOB_CLASS_ID && !evalDone )
{
IDerivedObject* derivedObj = static_cast<IDerivedObject*>(obj);
for ( int modStack = 0 ; modStack < derivedObj->NumModifiers() ; ++modStack )
{
if ( evalNext )
{
os = derivedObj->Eval( time, modStack );
evalDone = true;
break;
}
Modifier* mod = derivedObj->GetModifier(modStack);
if ( mod->ClassID() == SKIN_CLASSID )
evalNext = true;
}
obj = derivedObj->GetObjRef();
}
// evaluate possible non-derived object
if ( evalNext && !evalDone )
{
os = obj->Eval( time );
evalDone = true;
}
// convert to TriObject and get points
if ( evalDone && os.obj->CanConvertToType( Class_ID(TRIOBJ_CLASS_ID,0) ) )
{
Debug::println( " Evaluating object {0} before Skin modifier", nodeName );
// get TriObject
std::auto_ptr<TriObject> triAutoDel(0);
示例12: BindProc
INT_PTR CALLBACK BindProc(
HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
M3Mat *mp = (M3Mat*)GetWindowLongPtr(hWnd,GWLP_USERDATA);
if (!mp && msg!=WM_INITDIALOG) return FALSE;
int id = LOWORD(wParam);
int notify = HIWORD(wParam);
switch (msg) {
case WM_INITDIALOG:{
mp = (M3Mat*)lParam;
SetWindowLongPtr(hWnd,GWLP_USERDATA,(LONG_PTR)mp);
HWND modList = GetDlgItem(hWnd,IDC_MODLIST);
SendMessage(modList,LB_RESETCONTENT,0,0);
POINT lpPt; GetCursorPos(&lpPt);
SetWindowPos(hWnd, NULL, lpPt.x, lpPt.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
Object *pObj = mp->Wnode->GetObjectRef();
IDerivedObject *pDerObj = NULL;
Modifier *pMod = NULL;
if( pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
pDerObj = (IDerivedObject *) pObj;
for(int i = 0 ; i < pDerObj->NumModifiers() ; i++ )
{
pMod = pDerObj->GetModifier(i);
SendMessage(modList,LB_ADDSTRING,0,(LPARAM) (LPCTSTR) pMod->GetName());
}
}
SendMessage(modList,LB_SETCURSEL ,(WPARAM)-1,0);
break;}
case WM_COMMAND:
if (notify==LBN_SELCHANGE){
if(id==IDC_MODLIST){
int mkSel = SendMessage(GetDlgItem(hWnd, IDC_MODLIST), LB_GETCURSEL, 0, 0);
if(mkSel>=0){
Object *pObj = mp->Wnode->GetObjectRef();
IDerivedObject *pDerObj = NULL;
Modifier *pMod = NULL;
if( pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
pDerObj = (IDerivedObject *) pObj;
pMod = pDerObj->GetModifier(mkSel);
if(pMod->ClassID() == MR3_CLASS_ID) EnableWindow(GetDlgItem(hWnd,IDOK),TRUE);
else EnableWindow(GetDlgItem(hWnd,IDOK),FALSE);
}
}
}
}
switch (id) {
case IDOK:
{
int mkSel = SendMessage(GetDlgItem(hWnd, IDC_MODLIST), LB_GETCURSEL, 0, 0);
if(mkSel>=0){
Object *pObj = mp->Wnode->GetObjectRef();
IDerivedObject *pDerObj = NULL;
Modifier *pMod = NULL;
if( pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
pDerObj = (IDerivedObject *) pObj;
pMod = pDerObj->GetModifier(mkSel);
MorphR3 *mod = (MorphR3*)pMod;
if(mod->CheckMaterialDependency() ) {
EndDialog(hWnd,1);return TRUE;
}
// Make sure the node does not depend on us
mod->BeginDependencyTest();
mp->NotifyDependents(FOREVER,0,REFMSG_TEST_DEPENDENCY);
if (mod->EndDependencyTest()) {
// display cyclic warning
//
if (GetCOREInterface()->GetQuietMode()) {
TSTR cyclic;
cyclic = GetString(IDS_CANNOT_BIND);
GetCOREInterface()->Log()->LogEntry(SYSLOG_WARN,NO_DIALOG,GetString(IDS_CLASS_NAME),cyclic);
}
else
{
TSTR cyclic;
//.........这里部分代码省略.........
示例13: export_particle_spray
void SkeletonExporter::export_particle_spray(INode *node)
{
char sval[50];
Interval range = ip->GetAnimRange();
ObjectState os = node->EvalWorldState(0);
if (!os.obj) return;
SimpleParticle *partsys;
Object *p; IDerivedObject *q; Modifier *m;
partsys=(SimpleParticle *)os.obj;
Point3 row;
Matrix3 mat;
Mtl *materiale;
INode *padre=node->GetParentNode();
int mod_names=0, k, mod_count=0;
char modNames[25][50], refname[50];
int sf, sm, mf, n;
if ((padre) && (strcmp(padre->GetName(), "Scene Root")!=0))
sf=strlen(padre->GetName())+1;
else sf=0;
materiale=node->GetMtl();
if (materiale) sm=strlen(materiale->GetName())+1;
else sm=0;
mf=0;
// trovo i modificatori Wind e Gravity con il loro
// nome
p=node->GetObjOrWSMRef();
if ((p->SuperClassID()==GEN_DERIVOB_CLASS_ID) &&
(p->ClassID()==Class_ID(WSM_DERIVOB_CLASS_ID, 0)))
{
q=(IDerivedObject *)p;
n=q->NumModifiers();
mod_names=mod_count=0;
for (k=0; k<n; k++)
{
m=q->GetModifier(k);
Class_ID cidd = m->ClassID();
if ((cidd==Class_ID(WINDMOD_CLASS_ID, 0)) ||
(cidd==Class_ID(GRAVITYMOD_CLASS_ID, 0)) ||
(cidd==Class_ID(BOMB_OBJECT_CLASS_ID, 0)))
{
SimpleWSMMod *wm=(SimpleWSMMod *)m;
strcpy(refname, wm->nodeRef->GetName());
strcpy(modNames[mod_count], refname);
mod_names+=(strlen(refname)+1);
mod_count++;
}
}
}
write_chunk_header(fA3D, SPRAY_PARTICLE_SYSTEM_ID, node->GetName(),
4+sf+4+sm+ // padre, materiale
12+48+ //pivot, matrice world(t=0)
4+mf+ // nome mesh/oggetto
4+4+4+4+ // emitter: width, height, speed , variation
4+4+4+4+ // life, startTime, stopTime, max_particles
4+mod_names // num WSM, nomi WSM
);
fprintf(fTXT, "Spray particle system found\n");
fprintf(fTXT, "Name : %s\n", node->GetName());
if (padre) fprintf(fTXT, "Parent name : %s\n", node->GetParentNode()->GetName());
if (materiale) fprintf(fTXT, "Material name : %s\n", materiale->GetName());
if (makeADP)
fprintf(fADP, " particle %c%s%c\n {\n", '"', node->GetName(), '"');
// ----------- scrivo il padre (flag, nome) ------------------
fwrite(&sf, sizeof(int), 1, fA3D);
if (sf>0)
{
write_string0(fA3D, padre->GetName());
if (makeADP) fprintf(fADP, " father=%c%s%c;\n", '"', padre->GetName(), '"');
}
else
if (makeADP) fprintf(fADP, " father=%cNONE%c;\n", '"', '"');
// --------- scrivo il materiale di base (flag, nome) ----------
fwrite(&sm, sizeof(int), 1, fA3D);
if (sm>0)
{
write_string0(fA3D, materiale->GetName());
//if (makeADP) fprintf(fADP, " material=%c%s%c;\n", '"', materiale->GetName(), '"');
}
else
//if (makeADP) fprintf(fADP, " material=%cNONE%c;\n", '"', '"');
// --------------- scrittura del punto di pivot ----------------
GetPivotOffset(node, &row);
fprintf(fTXT, "Pivot point : %f, %f, %f\n", row.x, row.y, row.z);
write_point3(&row, fA3D);
// ------------------- scrittura matrice -----------------------
mat = node->GetNodeTM(0);
write_matrix(&mat, fA3D);
//.........这里部分代码省略.........
示例14: makeHavokRigidBody
void HavokExport::makeHavokRigidBody(NiNodeRef parent, INode *ragdollParent, float scale) {
this->scale = scale;
Object *Obj = ragdollParent->GetObjectRef();
Modifier* rbMod = nullptr;
Modifier* shapeMod = nullptr;
Modifier* constraintMod = nullptr;
SimpleObject* havokTaperCapsule = nullptr;
//get modifiers
while (Obj->SuperClassID() == GEN_DERIVOB_CLASS_ID) {
IDerivedObject *DerObj = static_cast<IDerivedObject *> (Obj);
const int nMods = DerObj->NumModifiers(); //it is really the last modifier on the stack, and not the total number of modifiers
for (int i = 0; i < nMods; i++)
{
Modifier *Mod = DerObj->GetModifier(i);
if (Mod->ClassID() == HK_RIGIDBODY_MODIFIER_CLASS_ID) {
rbMod = Mod;
}
if (Mod->ClassID() == HK_SHAPE_MODIFIER_CLASS_ID) {
shapeMod = Mod;
}
if (Mod->ClassID() == HK_CONSTRAINT_RAGDOLL_CLASS_ID || Mod->ClassID() == HK_CONSTRAINT_HINGE_CLASS_ID) {
constraintMod = Mod;
}
}
if (Obj->SuperClassID() == GEOMOBJECT_CLASS_ID) {
havokTaperCapsule = (SimpleObject*)Obj;
}
Obj = DerObj->GetObjRef();
}
if (!rbMod) {
throw exception(FormatText("No havok rigid body modifier found on %s", ragdollParent->GetName()));
}
if (!shapeMod) {
throw exception(FormatText("No havok shape modifier found on %s", ragdollParent->GetName()));
}
// Object* taper = ragdollParent->GetObjectRef();
IParamBlock2* taperParameters = Obj->GetParamBlockByID(PB_TAPEREDCAPSULE_OBJ_PBLOCK);
float radius;
enum
{
// GENERAL PROPERTIES ROLLOUT
PA_TAPEREDCAPSULE_OBJ_RADIUS = 0,
PA_TAPEREDCAPSULE_OBJ_TAPER,
PA_TAPEREDCAPSULE_OBJ_HEIGHT,
PA_TAPEREDCAPSULE_OBJ_VERSION_INTERNAL,
};
taperParameters->GetValue(PA_TAPEREDCAPSULE_OBJ_RADIUS, 0, radius, FOREVER);
int shapeType;
if (IParamBlock2* shapeParameters = shapeMod->GetParamBlockByID(PB_SHAPE_MOD_PBLOCK)) {
shapeParameters->GetValue(PA_SHAPE_MOD_SHAPE_TYPE,0,shapeType,FOREVER);
}
//Havok Shape
bhkShapeRef shape;
if (shapeType == 2) {
// Capsule
bhkCapsuleShapeRef capsule = new bhkCapsuleShape();
capsule->SetRadius(radius/scale);
capsule->SetRadius1(radius/scale);
capsule->SetRadius2(radius/scale);
float length;
taperParameters->GetValue(PA_TAPEREDCAPSULE_OBJ_HEIGHT, 0, length, FOREVER);
//get the normal
Matrix3 axis(true);
ragdollParent->GetObjOffsetRot().MakeMatrix(axis);
Point3 normalAx = axis.GetRow(2);
//capsule center
Point3 center = ragdollParent->GetObjOffsetPos();
//min and max points
Point3 pt1 = center - normalAx*(length/2);
Point3 pt2 = center + normalAx*(length/2);
capsule->SetFirstPoint(TOVECTOR3(pt1)/scale);
capsule->SetSecondPoint(TOVECTOR3(pt2)/scale);
capsule->SetMaterial(HAV_MAT_SKIN);
shape = StaticCast<bhkShape>(capsule);
}
else {
// Sphere
//CalcBoundingSphere(node, tm.GetTrans(), radius, 0);
bhkSphereShapeRef sphere = new bhkSphereShape();
sphere->SetRadius(radius/scale);
//.........这里部分代码省略.........