Entity is not beeing rendered when its using the RigidBody Component

aherber

Member
Contributor
Architecture
Hello Everyone,

im currently trying to import my own model for the arrows into the game. The model is rendered Correctly as long as i am not using the Rigidbody Component for the Entity. I thougth it might have been the model i was using. So i modelled a simple scaled cube in blender and exported it with normals and without the material information. I also exportet the UV-Map and painted it with a (very) simple texture. I followed the Guide for importing the model into the game that has been posted in the wiki and added The mesh component the the entity with the reference to the material i created for the cube. Does anybody else had the same problem ? If so how can i fix it. I am relativly new to blender and modelling so it may be that i did something wrong in blender.

Heres the data i have defined for the Material and the Meshcomponent of the Entity.

The arrow-Prefab file
"Mesh" : {
"mesh" : "engine:scaledCube",<-- referencing the .obj File int the mesh package
"material" : "engine:testScaledCube"
}


The JSON-File for the defined Material testScaledCube.mat:
{
"shader" : "engine:genericMesh",
"params" : {
"diffuse" : "engine:scaledCube", <--- referencing the the .png file in the texture packge
"colorOffset" : [1.0, 1.0, 1.0],
"textured" : true
}
}

I attached the model and the texture i used for the scaled cube.

Many thanks in advance.
 

Attachments

Immortius

Lead Software Architect
Contributor
Architecture
GUI
Check the log for errors, make sure you have commas between the different component sections in the prefab. Perhaps post your full prefab file?
 

aherber

Member
Contributor
Architecture
It seems to me that the Entitydefintion is loaded correctly (At least the log-File doesnt show any errors when it loads the ressources or the prefab file. Maybe im Missing something here. ) There are some Type Mapping Errors / Problem concerning the serialization/deserialization of some Fileds of the UnsupportedTypeComponent. I dont know if this is beeing done to test the detection of unsupported types or what the purpose of this Class is otherwise. The Entity (Arrows) are also spawned correcly. The number of spawned rigid bodies (numDropped) increases whenever i use the bow item. I attached the prefab-File and the log-File to this post.
The problem also occurs when i simple add the RigidBody Component to any of the Minions-Prefab files. I would be glad if someone could test that and tell me if doing so leads to the same results. What I find interesting about this is that when I load a Prefab-File that contains a rigid-Component but no MeshComponent and i add the MeshComponent after creating the Entity from the Prefab File, the mesh is rendered correcly. That is what i am doing to dynamically generated the corpses of dead entities. I also checked my graphics driver. Its up to Date.
 

Attachments

Immortius

Lead Software Architect
Contributor
Architecture
GUI
I'll have a look into it. The arrow does appear to be missing a Location.

UnsupportedTypeComponent is part of the unit tests, I don't know why it would be being detected unless your IDE isn't set up to put test classes in a separate location to the runtime classes.
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
Oh, one thing worth noting: If an entity has a non-kinematic rigid body then it will not interact well with location changes - a non-kinematic rigid body is under the control of the physics engine. It should only have forces and impulses applied to it. A kinematic rigid body on the other hand can be controlled directly, while still interacting as a solid with non-kinematic rigid bodies.

Support for kinematic rigid bodies is currently in my physics branch.

Edit: Did a quick test and put a rigid body on a gelatinous cube, rendered fine. So not sure, might need to look at your actual code.
 

aherber

Member
Contributor
Architecture
Immortius I merged the code the develop branch with my repository and added two different versions of the same bow to the goodiechest. One Bow is using the rigid body Component for the arrows(Itemname: Bow). The other is not (Itemname: BowNoRigidBodyArrow). Otherwise there are no differnces between the two items. When the Bow is used the "arrow" is beeing rendered correctly. Its not moving because the impulse is not applied to the arrow without the rigid body. When the other bow is fired the arrow is not being rendered. I hope this helps to find the error. Thanks for your help.
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
You forgot to include your arrow and scaled cube meshes and textures. :p

Anyhow, they are rendering, they're just appearing around the origin (0,0,0) and jittering about (small pro-tip - when things go wrong check the origin :) ). As is everything with a rigid body (i.e. dropped blocks).
 
Top