Jump to content

TFormVector??? Why wont it work?


Andy Gilbert
 Share

Recommended Posts

Hi.. does anyone know why the Vector will not stay local in this command?

 

mesh1:AddForceAtPoint(TFormVector(Vec3(0,Force,0),null,mesh1),TFormPoint(Vec3(0,0,2),null,mesh1))

 

It starts fine, but as soon as it turns on a different axis, its clear the force is not acting relative any more.

 

Thanks

Andy

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Link to comment
Share on other sites

I assume you want it local relative the mesh1 entity?

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

Hi tyler, yes thats right, i want to add a force at a point on my model, thats allways relative in position and rotation of the model, mesh1.

 

Thanks

Andy

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Link to comment
Share on other sites

It may be messing up if that is a mesh and not a model. Try using it on the parent of mesh1. (Passing mesh1.parent or whatever to the TForm... functions)

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

It may be messing up if that is a mesh and not a model. Try using it on the parent of mesh1. (Passing mesh1.parent or whatever to the TForm... functions)

 

Doesnt seem to be that ,so this is still unknown... I have tried it on mesh's, bodies?

 

Just cant seem to get it to work?

 

Andy

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Link to comment
Share on other sites

mesh1:AddForceAtPoint(TFormVector(Vec3(0,Force,0),null,mesh1),TFormPoint(Vec3(0,0,2),null,mesh1))

 

1. You can't add forces to a mesh, only a body or a model.

2. Is Force a float value or a Vec3 itself?

3. In Lua you use nil, not null.

4. AddForceAtPoint is global, so I am not sure why you are transforming the point and force to local space to begin with.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Hi Josh.. Ok ill answer the easiest.

 

1.You can't add forces to a mesh, only a body or a model.

I know that, and i am adding to a body, it was just a name i was using.

2.Is Force a float value or a Vec3 itself?

Im not to sure what you mean by that, but basically i have a variable which is a float that im using as my force in a Vec3.

3.In Lua you use nil, not null.

Ok, ill change that, it compiles fine so i didnt know any other.

4.AddForceAtPoint is global, so I am not sure why you are transforming the point and force to local space to begin with.

My originally question may answer that ( But basically because i want them local, not global)

 

Hi.. does anyone know why the Vector will not stay local in this command?

 

mesh1:AddForceAtPoint(TFormVector(Vec3(0,Force,0),null,mesh1),TFormPoint(Vec3(0,0,2),null,mesh1))

 

It starts fine, but as soon as it turns on a different axis, its clear the force is not acting relative any more.

 

Thanks

Andy

 

All, i want to do is add a force at a point on a body, and that force and position of it stay LOCAL to the body.

 

Thanks

Andy

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Link to comment
Share on other sites

Oh!

 

Since AddForceAtPoint is a global function, and the force and such you are adding is Local, you need to transform from the body's local space into global space. Switch nil and mesh1 positioning in the Transform command so mesh1 is first and nil is second, which should work properly :D

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

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.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...