Duion Posted March 13, 2016 Share Posted March 13, 2016 I noticed the weaponFireLight does not appear at the muzzle point of the weapon as it should be, but on the mount0 point, I found a resource that fixes this, but it is based on old code and no longer works: http://www.garagegames.com/community/resources/view/8394Someone has an idea how to do it now? Quote Link to comment Share on other sites More sharing options...
TorqueFan Posted March 16, 2016 Share Posted March 16, 2016 I had a free moment and took a glance at it. I hadn't tested anything, but can lead you in the right direction.The original resource you posted just changed a single function to use an overload. I found that same function, just shifted around to a new location. ° shapeBase.cpp - around Ln. 2625 void ShapeBase::renderMountedImage( U32 imageSlot, TSRenderState &rstate, SceneRenderState *state ) { ... getRenderImageTransform(imageSlot, &mat, rstate.getSceneState()->isShadowPass()); ... } So you should be able to just change that line to: getRenderImageTransform(imageSlot,imageData->muzzleNode,&posMat); Basically the registerLights() function from the older resource isn't used anymore. Instead the call to renderMountedImage() is now in ShapeBase::prepBatchRender().The only problem I'm seeing right away is 'imageData->muzzleNode' doesn't exist so you'll need to find a way to get ahold of the muzzleNode. I hadn't been using this node and all my models have custom setups, so it could be possible as well that you need to create and add such a node. All references to the 'muzzle' I can find at a quick look atm refer to the 'muzzlePoint' which isn't a node but a Point3F position. Let me know how you get along with it and if necessary I might be able to take a closer look. Happy Torque-ing! Quote Link to comment Share on other sites More sharing options...
Duion Posted March 16, 2016 Author Share Posted March 16, 2016 The muzzle point is in the weapon models, it is created manually when modelling the weapon to define where the puzzle point is. It is a node in the model called "muzzlePoint" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.