Jump to content

Switch weaponFireLight to muzzle point


Duion

Recommended Posts

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...