Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. What's the transform parameter in b2PolygonShape::TestPoint(p1, p2)?
  2. b2PolygonShape polygon;
  3. b2Vec2 vertices[] =
  4. {
  5.     b2Vec2(300, 400),
  6.     b2Vec2(350, 400),
  7.     b2Vec2(300, 500),
  8.     b2Vec2(350, 500)
  9. };
  10.  
  11. polygon.Set(vertices, 4);
  12. if(polygon.TestPoint(b2Transform(), b2Vec2(301, 405)))
  13. {
  14.     CCLOG(@"Point is inside");
  15. }
  16.        
  17. bool TestPoint(const b2Transform& transform, const b2Vec2& p) const;
  18.        
  19. btTransform identity; identity.SetIdentity();
  20. polygon.TestPoint(identity, ...