Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

108
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda