About Store Forum Documentation Contact
Donations:
178$/mo



Post Reply 
Ragdoll and custom skeleton - drawing
Author Message
Harry Offline
Member

Post: #1
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
Visit this user's website Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Bronze Supporter

Post: #2
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
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #3
RE: Ragdoll and custom skeleton - drawing
No, it has nothing to the drawing order. Please see the sceenshots. The first one presents the object with its skeleton. Second rendering of this object + drawing ragdol and skeleton when camera is far from it. Third the same case but camera is close to the object.


Attached File(s) Image(s)
           
03-04-2020 09:20 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Bronze Supporter

Post: #4
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
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #5
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
Visit this user's website Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Bronze Supporter

Post: #6
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
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #7
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
Visit this user's website Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #8
RE: Ragdoll and custom skeleton - drawing
do you have LoDs on this mesh?
03-05-2020 08:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #9
RE: Ragdoll and custom skeleton - drawing
What a helpful question! grin I didn't think to search there. I recreted LoDs and it works. Thanks Houge smile
03-05-2020 09:05 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply