deltaluca / nape

Haxe/AS3 Physics Engine
http://napephys.com
Other
542 stars 77 forks source link

Body groups. #10

Closed deltaluca closed 12 years ago

deltaluca commented 13 years ago

alla old nape 'Group', provide a grouping of bodies (constraints also?) for the purposes of interaction callbacks and complementing masking for interaction control.

deltaluca commented 12 years ago

InteractionGroups (being old-nape style groups purely for interaction control; but with more expressive power) implemented in groups branch.

var g = new InteractionGroup(ignoreinteractions:Bool=false); g.bodies.add .... g.shapes.add ... //later: g.compounds.add ... g.groups.add ...

in Space narrowPhase, two shapes are excluded from interacting if the most-recent-common-ancestor in the InteractionGroup tree says they should be ignored (treating the Body as a non-interactionGroup parent of a Shape when shape.group is null)


Soon Compound's (corresponding to old-nape Groups more closely) for grouping of bodies and constraints like flash Movieclips will be started (including full callback citizenship like Shapes/Bodies; infact all 3 will be subtypes of the Interactor type (differs in that they actually extend this type in the groups branch).

deltaluca commented 12 years ago

InteractionGroups finished a couple days ago, and Compounds virtually finished now also.

Only thing left to add (bar existance of any bugs eluding me) is some utils for transformations of Compounds (including possibly transform of constraints to complement it like constraints now can be copied in the compounds branch)

deltaluca commented 12 years ago

Merged into master and released.