Closed bobekos closed 5 years ago
You'll want node.getLocalRotation or node.getWorldRotation.
When Renderables are used, they are used as a template and copied or shared with a node. A single renderable may be copied to many nodes cheaply using this. But it means the data you are looking for is not owned by a Renderable. Only Nodes actually have a position/orientation in the world.
Hallo @malik-at-work
thanks for the response. Is there another option to replace one renderable with another in the same node? For example i convert the example gltf (see above) to sfb with the default gltf material (it is a simple plane). Now i want to create a texture cube over shapefactory and it should appears at the same location, with the same size and rotation as the renderable from the sfb. Background of the whole thing is, in the example above there is no chance to add a texture at runtime to the renderable. The only parameters i get from getMaterial method are "metallicFactor, roughnessFactor, baseColorFactor, emissiveFactor".So i can't modify the renderable created from the sfb file. That's why I thought I could just copy the renderable data and paste it to a renderable created from shape factory to control the texture. Or is there another way to do that without modify the sfb file?
@malik-at-work
But I can change the material at runtime. That is actually all I wanted. First read then do. I'm sorry about this 😃
I know that to get the real model size you can use the getCollisionShape function and cast it to the Box Object. But it seems that the quaternion for the rotation is not filled. It doesn't matter which object is loaded the result is always the same.
Also
doesn't work.
Is this a bug? And how can i copy the rotation from one renderable to another without modify the node?
many thanks in advance
Ps. The gltf model for the example download