x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
GameEntity.cpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\GameEntity.cpp
Girar
Efecto
Propiedad
Historial
#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
Dirección de la página
Dirección del archivo
Anterior
17/45
Siguiente
Descargar
( 1 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.