Git Product home page Git Product logo

Comments (9)

DwiYI avatar DwiYI commented on June 26, 2024 1

Thank you for your suggestion. The problem come from filter parameter. My code sending garbage value. I will close this.

from chipmunk2d.

aismann avatar aismann commented on June 26, 2024

It works here

from chipmunk2d.

DwiYI avatar DwiYI commented on June 26, 2024

That's right, the demo is working fine. but not on my code. I don't know how to do debug that because example working fine. Do you know possible cause of that ?. its binding

from chipmunk2d.

aismann avatar aismann commented on June 26, 2024

Look at your code ;)

from chipmunk2d.

DwiYI avatar DwiYI commented on June 26, 2024

this is dart binding

late SegmentQueryInfo info;
(Shape shape, SegmentQueryInfo info) segmentQueryFirst({required Vector2 start, required Vector2 end, required double radius, required ShapeFilter filter}) {
  var sh = _bindings.cpSpaceSegmentQueryFirst(_space, start.toCpVect().ref, end.toCpVect().ref, radius, filter._toPointer().ref, 
           info._segmentQueryInfo);
  return (Shape._fromPointer(sh), info);
}

this is query code


 widget.game.physicUpdateAfter = (p0) {
      var (lq.Shape shape, lq.SegmentQueryInfo info) = widget.game.space.segmentQueryFirst(start: start, end: end, radius: 10, filter: shapeFilterAll);
      if (shape.isExist) {
        poi = info.point;
        nor = info.normal;
        alp = info.alpha;
        lineDraw1 = true;
        desc = 'Segment Query: Dist(${alp * (end - start).length}) Normal(${nor.x}, ${nor.y})';
      } else {
        lineDraw1 = false;
        alp = 1;
        desc = 'Segment Query (None)';
      }
    };

from chipmunk2d.

aismann avatar aismann commented on June 26, 2024

work this correct : shape.isExist ?

from chipmunk2d.

DwiYI avatar DwiYI commented on June 26, 2024

thats, only check against null,

from chipmunk2d.

aismann avatar aismann commented on June 26, 2024

add some debug outputs on your code.
Hope this is helping you.

from chipmunk2d.

aismann avatar aismann commented on June 26, 2024

thats, only check against null,

Thats seems not correct ;) the object isn't null
check all input parameters:

from chipmunk2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.