PropertyMap working on all shapes
by Ronald J Nelson · in Torque Game Engine · 09/11/2006 (8:32 pm) · 6 replies
Hi, I am at another critical point of where I need to concentrate my efforts in my project and was hoping maybe someone could save me a bit of time here. I am trying to get the propertyMap.cs as well as the rest of the materialMap system to have influence over the remaining shape types in the game not just terrain and interior objects.
Has anyone done this before, if so how? If not, anyone got any ideas? I am seeing a huge amount of different shape types and I am sure there must be one universal way to do it, just don't know how yet.
I am wanting to use this for my projectile code so it can read properties about an object based on information I set up in the propertyMap.cs file. I have successfully done this for terrains and interiors, but up to now it has no effect on the other objects.
I appreciate your time and any assistance you can give me. Thank you.
Has anyone done this before, if so how? If not, anyone got any ideas? I am seeing a huge amount of different shape types and I am sure there must be one universal way to do it, just don't know how yet.
I am wanting to use this for my projectile code so it can read properties about an object based on information I set up in the propertyMap.cs file. I have successfully done this for terrains and interiors, but up to now it has no effect on the other objects.
I appreciate your time and any assistance you can give me. Thank you.
#2
09/12/2006 (2:00 am)
I guess this is what I need, I need to now how I can get the texture on an object that is neither terrain or interior and use it to get the properties from the propertyMap.cs. Obviously this is not a standard practice as far as I can tell. I am hoping someone else has at least put some time into this before me and can offer some wisdom.
#3
09/12/2006 (2:32 am)
I applaud your stamina in this, Ron. I dont know for how long you have been tinkering with property maps, materials and piercing bullets :) Wish I could help.
#4
I would just like to know how to get this information from a dts object?
09/12/2006 (5:24 pm)
Thanks Stefan, I am sure there has to be a similar function for doing this because I have looked at everything from player.cc all the way to TSShapeInstance and in most cases the materialList and materialMap files are included and there are material based functions. However they definitely use it differently, durr they are different file types LOL.I would just like to know how to get this information from a dts object?
#5
I could really use an assist on this one guys.
09/14/2006 (10:22 am)
OK I have figured out where the information in TSShapeInsance is stored. However, I have no idea how to perform a staticCast against it to give me the specific instance of S32 materialIndex or from TSMaterialList * ml or even from TSMaterialList* mMaterialList. I could really use an assist on this one guys.
#6
09/14/2006 (3:13 pm)
Well I see now that I can't use the same type of technique used for interior objects because it is off of BSP information which in this case applies to .dif objects and not .dts. Therefore I am going to have to try a similar approach that was used in the terrain files.
Torque Owner Ronald J Nelson
Code Hammer Games
if( rInfo.object->getTypeMask() & TerrainObjectType ) { TerrainBlock* tBlock = static_cast<TerrainBlock*>(rInfo.object); S32 mapIndex = tBlock->mMPMIndex[0]; if (mapIndex != -1) { MaterialPropertyMap* pMatMap = static_cast<MaterialPropertyMap*>(Sim::findObject("MaterialPropertyMap")); const MaterialPropertyMap::MapEntry* pEntry = pMatMap->getMapEntryFromIndex(mapIndex); if(pEntry) { pMatType = pEntry->matType; } } }Then I use this for interiors:
MaterialPropertyMap* pMatMap = static_cast<MaterialPropertyMap*>(Sim::findObject("MaterialPropertyMap")); const MaterialPropertyMap::MapEntry* pMatEnt = pMatMap->getMapEntryFromIndex(rInfo.material);I don't think my method that is working on interiors works the same for shapebase objects. I would really appreciate a word or two on this. Thanks again.