Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

112
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda