For any feature requests to either the Skyline Engine or the websites and forums please leave your suggestion here.

collision()

collision()

Postby ant0N » 20 Jan 2015, 12:28

Hi guys! :D
First of all, congratulations with the updated forum! It looks much better now.

In many game engines have a very useful callback function :
Code: Select all
function collision(entity, speed)
    if entity == enemy then
        -- free entity
    end

    if speed > 10 then
        --play sound
    end
end


this is very useful for game objects, such as barrel will make a sound when dropped...
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: collision()

Postby SolarPortal » 20 Jan 2015, 12:40

we could make a function to do that.
but we do have collision events.

Code: Select all
function onCollision_Start (int hitID)
function onCollision_Stay (int hitID)
function onCollision_End (int hitID)


obviously the functions will need enabled on the properties, but they do work.
having a speed on impact though could be interesting for simplicity

We have been upgrading the physics collision events to return all information: also just noticed that the API is out of date and does not display these functions:

Code: Select all
physics.getContactNumShapes()
position = newType.vec3(physics.getContactPoint( shapeID ));
normal = newType.vec3(physics.getContactNormal());
force = physics.getContactForce( shapeID )); -- i think this one is still being worked on.
id_contact = physics.getContactEntID();


thanks again! :D
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 7 guests

cron