x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
GameEntity.cpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\GameEntity.cpp
旋转
特效
属性
历史版本
#include "GameEntity.h" using namespace GameFactory; GameEntityOld::GameEntityOld(void) { } SceneNode* GameEntityOld::CloneSceneNode(const SceneNode* node, SceneNode* newParent, const String &suffix){ //NODE: this function only work if: every node is a scene node, every attached object is an entity //clone the node SceneNode* ret = newParent->createChildSceneNode(node->getName()+suffix); ret->setPosition(node->getPosition()); ret->setOrientation(node->getOrientation()); ret->setScale(node->getScale()); //clone all child nodes for (Node::ConstChildNodeIterator iter = node->getChildIterator();iter.hasMoreElements();){ SceneNode* element = (SceneNode*)iter.getNext(); CloneSceneNode(element,ret,suffix); } //clone all of its entities for (SceneNode::ConstObjectIterator iter2 = node->getAttachedObjectIterator();iter2.hasMoreElements();){ Entity* ent = (Entity*)iter2.getNext(); Entity* newEnt = ent->clone(ent->getName()+suffix); ret->attachObject(newEnt); //clone all bone attachments for (Entity::ChildObjectListIterator iterBone = ent->getAttachedObjectIterator();iterBone.hasMoreElements();){ Entity* attachedEntity = (Entity*)iterBone.getNext(); TagPoint* tagPoint = (TagPoint*)attachedEntity->getParentNode(); Entity* newAttachedEntity = attachedEntity->clone(attachedEntity->getName()+suffix); String boneName = tagPoint->getParent()->getName(); newEnt->attachObjectToBone(tagPoint->getParent()->getName(),newAttachedEntity,tagPoint->getOrientation(), tagPoint->getPosition()); } } return ret; } void GameEntityOld::Translate(Vector3 vec){ actor->moveGlobalPosition(Vector3ToNxVec3(vec)); mNode->setPosition(vec); //mNode->translate(vec); } void GameEntityOld::Rotate(Quaternion q){ Degree angle; Vector3 axis; q.ToAngleAxis(angle,axis); actor->moveGlobalOrientationQuat(NxQuat(angle.valueDegrees(),Vector3ToNxVec3(axis))); //mNode->rotate(q); mNode->setOrientation(q); }
GameEntity.cpp
网页地址
文件地址
上一页
17/45
下一页
下载
( 1 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.