Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

111
Views
How to effectively add a non-attached collider and check for intersections using Rapier2D?

I am currently working on a project using Rapier's JavaScript bindings. I am trying to check for intersections within a specified shape. I can't seem to get a response from the query I'm using.

var collider = this.world.createCollider(new RAPIER.ColliderDesc(new RAPIER.Cuboid(10, 10)))
collider.setActiveCollisionTypes(RAPIER.ActiveCollisionTypes.ALL)
collider.setActiveEvents(RAPIER.ActiveEvents.INTERSECTION_EVENTS)
collider.setSensor(true)
collider.setTranslation({x: 100, y: 100})
collider.setCollisionGroups(0xffffffff)

var shape = new RAPIER.Cuboid(10, 10);
var shapePos = { x:105, y: 100 };
var shapeRot = 0.1;
var groups = 0xffffffff;
this.world.intersectionsWithShape(shapePos, shapeRot, shape, groups, (handle) => {
     console.log("The collider", handle, "intersects our shape.");
     return true; // Return `false` instead if we want to stop searching for other colliders that contain this point.
});

I should be getting a single message in the output, saying that the collider intersects the shape, but I'm getting know such thing. I know the execution is moving forward; what am I doing wrong?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!