Comments (1)
Hello,
Sorry, collision events are not implemented yet.
But you can detect collision between shapes.
For example, this is a method to check whether shapes are colliding or not:
public function isCollided(shape1:Shape, shape2:Shape):Boolean {
var contacts:Vector.<Contact>;
var numContacts:uint;
if (shape1.numContacts < shape2.numContacts) {
contacts = shape1.contacts;
numContacts = shape1.numContacts;
} else {
contacts = shape2.contacts;
numContacts = shape2.numContacts;
}
for (var i:int = 0; i < numContacts; i++) {
var contact:Contact = contacts[i];
if (contact.shape1 == shape1 && contact.shape2 == shape2 ||
contact.shape2 == shape1 && contact.shape1 == shape2) {
return true;
}
}
return false;
}
Thanks.
from oimophysics.
Related Issues (20)
- Failed to build a simple TypeScript example with Browserify HOT 2
- Please, upload a new version to NPM HOT 7
- Please,A new version Vehicle HOT 1
- Inertia of Cone Geometry seems wrong HOT 1
- Uncaught ReferenceError: HxOverrides is not defined HOT 2
- "Hello World" on the server side with OimoPhysics HOT 8
- I can't change gravity in OimoPhysics 1.2.4 HOT 2
- How can I find out which object I hit with the ray? HOT 3
- Incorrect behaviour of rigidbodies with high mass HOT 1
- Allow for models? HOT 1
- ConvexHullGeometry.hx - _volume (issue)
- BvhBroadPhase.hx - Memory leak HOT 2
- Bug: RigidBody.setType before addShape makes body not work HOT 1
- How to prevent character from rotating when moving at an angle to an incline HOT 1
- Question: How to change the centre of mass location? HOT 10
- No longer compiles HOT 3
- about impulse
- Support for Compiling to SWC
- Please, create the Discussions tab HOT 1
- Add Linear Factor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oimophysics.