Jump to content

Recommended Posts

Posted

In c++/bmax we use collision callback to have infos from collision wath i should use on lua?

Is there any way to create a vector/list on lua?

Thx.

Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10.

Posted

Anyone known? Seem really strange.. There is nobody who need to check collision on theyr game using lua?

I think to have found a sort of solution for list/vector.

Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10.

Posted

Care to share?

 

Robin

Programmer , Intel Quad core, NVIDIA GeForce GT 220, Windows 7 Pro, Galaxy Tab 2 ( 7" and 10"), LE2,LE3,3DWS

Posted

I need to check it before.. Lua array are undefinited, so you can create an array like this:

 

array = {}
for i=1, 100 do
     array[i] = 0
end

 

In this case we could do something like this i guess:

 

Function addLast (a)
     array[counter] = a
     counter = counter + 1
end

Function removeFirst()
     a = array[0]
     for i=0, counter-1
           array[i] = array [i+1]
     end
     array[counter] = nil
     counter = counter - 1
     return a
end 

 

I need to check it, it obviously not a list but it can work.

Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10.

Posted

Thx for the answer!

Anyway my big problem is about collision as i am making a tool wich need collision..

Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10.

Posted

Hi,

Table is the best way to go! however you can also use Vec2,Vec3,Vec4 functions to create 2/3/4 dimentional vectors.

vec1=Vec3(0,0,0)

 

about collisions, LE have a object:Collision() function that runs when a collision occures. you can use it like this :

function object:Collision(entity,position,normal,force,speed)
    ...
end

 

where Entity is the entity that collided this object.

 

you can see "oildrum.lua" (oildrum script) for example

  • Upvote 1
Posted

Mmm seem this doesn't help me at all.

What i am trying to do if check if a body (created by code) is collided or not. I don't need to know more other infos, just if it's collided.

The oildrum code it's seem a little different it created a class for a model and so took the object and check the collision.. Did i need to create an empty gmf and create a lua file as oildrum have?

Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10.

Posted

There is a collision object function you can use with models. See the basic Lua tutorial.

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

Posted
There is a collision object function you can use with models.

That was my tought there is no way to check the collision from the body itself.. To do this i should modify all the models to handle collision with that body OR create an "empty" model to do this..

So for example if i wanna check the collision from 2 bodies created directly on code?

Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10.

Posted

mmm how? There is no any docs on it.. I am able to do it on c++ and bmax, but don't know the way to do it on lua..

Intel Corei7-6700, NVIDIA GeForce GTX 980, 32GB DDR4, W-10.

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.

×
×
  • Create New...