About Store Forum Documentation Contact



Post Reply 
Mesh variation
Author Message
LDA Offline
Member

Post: #1
Mesh variation
Hello,

I have a bug with a custom static object, may be I'm doing something wrong so that all my instancied objects in the world have the same texture variation, and not the one chosen by the mapper.

The object: has 4 variations, and is a custom OBJ

The creation source code of the object :
Code:
void Roof::create(Object &obj)
{
   super.create(obj);
   if(phys)actor.create(*phys, 0, scale).matrix(_matrix)
                .obj   (this)
                .group (1); // hack        
   this->m_BoxZone = new Box(actor.box()); // on recupere la box physique du modele
   this->m_BoxZone.setY(0,10); // on la rescale en hauteur pour que ca collide avec la capsule du codeur
}

I haven't touch anything about the incoming &obj... But I was curious to check the mesh variation, so I added :

Code:
uint meshvar = obj.meshVariationID();
   this->mesh_variation = meshvar;

While debugging I could see random integers values in meshvar.
Is there something wrong with what I'm doing ?
Or maybe my hole object is maybe corrupted ?

Sample project: https://drive.google.com/file/d/0B6VnmyM...sp=sharing
11-01-2015 02:31 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Mesh variation bug
Hi,

This is not a bug, this is OK, variation ID is a random number.
What you want is obj.meshVarationIndex
and then pass that to SetVariation before making the draw call.
and reset SetVariation(0) after the draw call
11-01-2015 10:05 PM
Find all posts by this user Quote this message in a reply
LDA Offline
Member

Post: #3
RE: Mesh variation
Ok, Got it, thanks wink
11-02-2015 10:11 AM
Find all posts by this user Quote this message in a reply
Post Reply