how scale a NxOgre::TriangleMesh

Felipe

27-11-2007 20:59:45

my SceneNode is scale, but Nxogre::Actor not.
how scale a NxOgre::TriangleMesh ?

my code:
Entity *ent = mSceneMgr->createEntity( name, mesh);
SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode( "Node" +name);
node->attachObject( ent );
node->setPosition(position);
node->setOrientation(orientation);
node->setScale(scale);

Scene->createActor(name,new NxOgre::TriangleMeshShape(mesh),NxOgre::Pose(position, orientation),"mass: 100 , static: yes");


help me!

betajaen

27-11-2007 21:10:31

help me!

Help you?

alienskull

28-11-2007 00:46:24

Entity *ent = mSceneMgr->createEntity( name, mesh );
SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode( "Node" + name );
node->attachObject( ent );
node->setPosition( position );
node->setOrientation( orientation );
node->setScale( scale );

NxOgre::ShapeParams sp;
sp.setToDefault();
sp.mMeshScale = NxVec3( scale.x, scale.y, scale.z );

Scene->createActor( name, new NxOgre::TriangleMeshShape( mesh, sp ), NxOgre::Pose( position, orientation ), "mass: 0 , static: yes" );


but you might want to use createBody instead of creating an entity, scenenode and an actor... createBody takes care of that for you.. thanks betajaen

NxOgre::ShapeParams sp;
sp.setToDefault();
sp.mMeshScale = NxVec3( scale.x, scale.y, scale.z );

NxOgre::ActorParams ap;
ap.setToDefault();
ap.mNodeScale = scale;
ap.mMass = 0;
Scene->createBody( mesh, new NxOgre::TriangleMeshShape( mesh, sp ), NxOgre::Pose( position, orientation ), ap );

Felipe

28-11-2007 00:55:18

alienskull

thanks for your help!

lamberreke

15-05-2008 14:43:47

Mmm, same problem, but this doens't do the trick for me strangely enough :s

NxOgre::ShapeParams sp;
sp.setToDefault();
sp.mMeshScale = NxVec3( 20, 20, 20);

Body * tempBody = nxScene->createBody("JUMP.mesh",new TriangleMeshShape("JUMP.nxs",sp),Vector3(0,10,100),"mass:100;node-scale: 20 20 20");


De visual part is scaled, but the physics part isn't...
I'm using 0.9, any one has the same prob?

betajaen

15-05-2008 15:01:57

I'm not sure if you can scale "nxs" meshes in 0.9, have you tried "Jump.MESH" instead?