Harry
Member
|
Ragdoll and custom skeleton - drawing
I'm playing with Inventory tutorial. I created an item with custom skeleton and ragdoll enabled. I added AnimatedSkeleton and Ragdoll members to extended Game.Item class and created them based on the data from obj file.
In update method I call ragdoll.toSkel(skel) method and in draw I call
Code:
if(mesh)
{
SetVariation(mesh_variation); mesh->draw(skel);
SetVariation();
}
Even without Frustum Culling. The same applies for the shadows. For debuging purposes I'm drawing skeleton and ragdoll, which behaves as expected - ragdoll is working. But the mesh is drawn like there was no skeleton nor ragdoll unless I'm close to the object around 1 meter far.
Am I doing something wrong? I was checking sources for Character class and I haven't found anything special.
|
|
03-03-2020 10:57 PM |
|
RedcrowProd
Member
|
RE: Ragdoll and custom skeleton - drawing
But the mesh is drawn like there was no skeleton nor ragdoll unless I'm close to the object around 1 meter far.
what do you mean by that ? can you post a screenshot ?
so is the skeleton and ragdoll drawing fine, but the mesh is drawn on top ?
|
|
03-04-2020 02:32 AM |
|
Harry
Member
|
|
03-04-2020 09:20 AM |
|
RedcrowProd
Member
|
RE: Ragdoll and custom skeleton - drawing
Have you tried to setmatrix on that skel after you applied the toSkel() ?
|
|
03-04-2020 09:08 PM |
|
Harry
Member
|
RE: Ragdoll and custom skeleton - drawing
I don't think it will work. SetMatrix won't have any effect in update method. It is useful only when performing custom mesh or shapes rendering outside WorldManager.
For me it looks like more like vertices are not transformed according to the skeleton because simpler shader is used. But I can't figure out why. This does not happen for Character.
I did a check with custom animation and the same thing happens - animation is visible only when close to the camera.
Code:
skel.updateBegin().clear().animate(UID(2573638551, 1287408989, 1658526084, 3794234786), Time.time()).updateMatrix(matrixScaled()).updateEnd();
|
|
03-04-2020 09:46 PM |
|
RedcrowProd
Member
|
RE: Ragdoll and custom skeleton - drawing
Right, it could be because its enable/disable ? Maybe there is some automatic trigger point in the back and you need to set up your item as enable with kinematic false ?
If you look under game.item it does state something about that doing it when area change state
(This post was last modified: 03-04-2020 11:14 PM by RedcrowProd.)
|
|
03-04-2020 11:09 PM |
|
Harry
Member
|
RE: Ragdoll and custom skeleton - drawing
I tried different approach - I forgot there is Animatable class, which without any modifications should handle this correctly. But it isn't. The object behaves exactly the same as in my custom Item extension.
|
|
03-05-2020 08:17 PM |
|
Houge
Member
|
RE: Ragdoll and custom skeleton - drawing
do you have LoDs on this mesh?
|
|
03-05-2020 08:57 PM |
|