File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -605,4 +605,8 @@ -(void)testBreakingJoints
605
605
XCTAssert (joint4.valid , @" " );
606
606
}
607
607
608
+ // TODO
609
+ // * Check that body and shape settings are preserved through multiple add/remove cycles and are actually applied to the cpBody.
610
+ // * Check that changing properties before and after adding to an active physics node updates the properties correctly.
611
+
608
612
@end
Original file line number Diff line number Diff line change @@ -135,9 +135,17 @@ -(void)setCollisionGroup:(id)collisionGroup {
135
135
}
136
136
137
137
// TODO these need a reference to the space to intern the strings
138
- // Needs to be deferred?
139
138
-(NSString *)collisionType {return _collisionType;}
140
- -(void )setCollisionType : (NSString *)collisionType {_collisionType = [collisionType copy ];}
139
+ -(void )setCollisionType : (NSString *)collisionType
140
+ {
141
+ CCPhysicsNode *physics = self.physicsNode ;
142
+ if (physics){
143
+ _collisionType = [physics internString: collisionType];
144
+ self.shape .collisionType = _collisionType;
145
+ } else {
146
+ _collisionType = [collisionType copy ];
147
+ }
148
+ }
141
149
142
150
-(NSArray *)collisionCategories {
143
151
if (_collisionCategories){
@@ -207,7 +215,7 @@ -(void)willAddToPhysicsNode:(CCPhysicsNode *)physics nonRigidTransform:(cpTransf
207
215
// nil the array references to save on memory.
208
216
// They will rarely be read back and we can easily reconstruct the array.
209
217
_collisionCategories = nil ;
210
- _collisionType = nil ;
218
+ _collisionMask = nil ;
211
219
212
220
[self rescaleShape: transform];
213
221
}
You can’t perform that action at this time.
0 commit comments