Jump to content

Immovable objects


zelcard
 Share

Recommended Posts

47 minutes ago, zelcard said:

Greetings,

is it possible for two immovable objects (object1.body.immovable = true; object2.body.immovable = true;) to collide? If yes how that can be achieved? Thanks!

The short answer is no. WHY? Because they are both immovable so they should never collide.

Link to comment
Share on other sites

3 minutes ago, Iszard said:

I'm running into the same problem with static / kinematic bodies.

Personally I want near pixel perfect collision detection without transferring velocity or any means.

Only one of the objects should have body.immovable = true and then they wont transfer velocities. 

Link to comment
Share on other sites

1 minute ago, Ralph said:

Only one of the objects should have body.immovable = true and then they wont transfer velocities. 

then object not immovable is still rotated or altered and if in a pool with maintain that when reused although params such as rotation or angle still return 0

Link to comment
Share on other sites

Just now, Iszard said:

then object not immovable is still rotated or altered and if in a pool with maintain that when reused although params such as rotation or angle still return 0

I dont understand what this means. 

Link to comment
Share on other sites

23 hours ago, zelcard said:

Greetings,

is it possible for two immovable objects (object1.body.immovable = true; object2.body.immovable = true;) to collide? If yes how that can be achieved? Thanks!

sprite1.body.mass = 99999999;

sprite2.body.mass = 99999999;

Link to comment
Share on other sites

@Iszard

@zelcard

What you are looking for is not collision but overlap.

http://phaser.io/docs/2.6.1/Phaser.Physics.Arcade.Body.html#onOverlap

http://phaser.io/examples/v2/sprites/overlap-without-physics

Collision means that two physical bodies hit each other and each of the bodies needs to react to the physics that a collision imply. 

Overlap is just about one sprite being on top(overlapping) another sprite.

Link to comment
Share on other sites

4 minutes ago, symof said:


@Iszard

@zelcard

What you are looking for is not collision but overlap.

http://phaser.io/docs/2.6.1/Phaser.Physics.Arcade.Body.html#onOverlap

http://phaser.io/examples/v2/sprites/overlap-without-physics

Collision means that two physical bodies hit each other and each of the bodies needs to react to the physics that a collision imply. 

Overlap is just about one sprite being on top(overlapping) another sprite.

can you help with overlap then with pixel perfect collision detection because as fair as I know it's bounds are the image rect.

Link to comment
Share on other sites

@Iszard

http://stackoverflow.com/questions/2272179/a-simple-algorithm-for-polygon-intersection

http://phaser.io/examples/v2/input/pixel-perfect-click-detection

There is no quick fix, time to start reading up on overlaps.

And that's pretty much it. You want a very niche type of collision, then you need to make it.

But. You. Don't. Need. Pixel. Perfect. Collisions. In. Games.

Also important to note are the software/hardware restrictions of said physics engine. P2 is considered Advanced and having more then 50 physics bodies will start causing serious frame drop on most devices. If you have 5 players and they each shoot 10 bullets you will have reached that limit in a blink.

 

And now you should stop posting here as this does not relate to the OP's topic(aka topic hijacking).

 

Link to comment
Share on other sites

18 minutes ago, symof said:

@Iszard

http://stackoverflow.com/questions/2272179/a-simple-algorithm-for-polygon-intersection

http://phaser.io/examples/v2/input/pixel-perfect-click-detection

There is no quick fix, time to start reading up on overlaps.

And that's pretty much it. You want a very niche type of collision, then you need to make it.

But. You. Don't. Need. Pixel. Perfect. Collisions. In. Games.

Also important to note are the software/hardware restrictions of said physics engine. P2 is considered Advanced and having more then 50 physics bodies will start causing serious frame drop on most devices. If you have 5 players and they each shoot 10 bullets you will have reached that limit in a blink.

 

And now you should stop posting here as this does not relate to the OP's topic(aka topic hijacking).

 

Done all this reading already but no need to further this topic (aka topic hijacking)

Link to comment
Share on other sites

1 hour ago, Iszard said:

can you help with overlap then with pixel perfect collision detection because as fair as I know it's bounds are the image rect.

Do you mean you want collision to happen whenever the actual sprite image overlaps, and not when the transparent parts do? 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...