Requesting groupIndex support for Box2D

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Skasi
Prole
Posts: 27
Joined: Thu Feb 12, 2009 2:25 pm

Requesting groupIndex support for Box2D

Post by Skasi »

As my game needs more than 16 different "collision types" I need to be able to use the groupIndex option that Box2D offers.

In return I will use a nice little OBEY Avatar. What do you say? :)
User avatar
counterfactual_jones
Prole
Posts: 24
Joined: Mon Feb 09, 2009 10:14 am

Re: Requesting groupIndex support for Box2D

Post by counterfactual_jones »

I thought the shapedata was (possibly) unique for each shape?

So you do this:

Code: Select all

    circle_shape:setData("Ball") -- Set a string userdata 
    world:setCallback(collision) 
then have this:

Code: Select all

 function collision(a, b, c) 
     if a == "Ball" then
         -- do something
     end
     if b == "Ball" then
         -- do something
     end
 end 
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Requesting groupIndex support for Box2D

Post by rude »

Added.
User avatar
Skasi
Prole
Posts: 27
Joined: Thu Feb 12, 2009 2:25 pm

Re: Requesting groupIndex support for Box2D

Post by Skasi »

counterfactual_jones: It's not about shapedata.
Take a look at 6.2.3. Filtering in the box2D manual for a description. :)

rude: What did you add? The support? The request to a todo? Tell me. :roll:
Post Reply

Who is online

Users browsing this forum: No registered users and 269 guests