Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected boolean castTopoint(Vector2 start, Vector2 end, float distance ){
- this.rayCastDistance = 1f;
- this.gameScreen.rays.add(new Rectangle(start.x,start.y,end.x,end.y));
- if(start.dst(end) == 0f){
- return false;
- }
- if(this.body != null){
- body.getWorld().rayCast(this, start, end);
- }
- return this.rayCastDistance >= distance;
- }
- @Override
- public float reportRayFixture(Fixture fixture, Vector2 point,
- Vector2 normal, float fraction) {
- this.rayCastDistance = fraction;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment