famo.us access to collisionData upon collision event

famo.us access to collisionData upon collision event

By : user2955747
Date : November 22 2020, 10:48 AM
wish of those help In the famo.us source I see that two things are emitted upon collision: the 'collision' string, and a variable called collisionData, like this: (physics/constraints/Collision.js, lines 112-122): , Get the object from the return event object:
code :
collision.on('collision', function(data) {
  // do stuff
  console.log('data', data);
  console.log('target', data.target);
  console.log('source', data.source);
// assuming your body is called body and body1 respectively
//   also, this is just partial code.
var uniqueID = 0;
body.particle = new Circle({
  radius: 50,
  position: [x, y, 0]
body1.particle = new Circle({
  radius: 50,
  position: [x, y, 0]

body.particle.uniqueID = 'body' + uniqueID;
uniqueID += 1;
body1.particle.uniqueID = 'body' + uniqueID;
collision.on('collision', function(data) {
  // do stuff
  console.log('target id', data.target.uniqueID);
  console.log('source id', data.source.uniqueID);

Share : facebook icon twitter icon
Famo.us install gives me a a blank browser page with the famo.us icon

Famo.us install gives me a a blank browser page with the famo.us icon

By : Matius Celcius Sinag
Date : March 29 2020, 07:55 AM
I hope this helps you . No, you are not missing anything. That is the example app that is generated during the scaffolding process.
Look for the file app/src/main.js ..
Famo.us polygons collision support

Famo.us polygons collision support

By : Lily Belarosa
Date : March 29 2020, 07:55 AM
I wish did fix the issue. Currently the physics engine is limited in a number of ways. There are no polygon bodies and barely even rectangular bodies. The only type of collision constraints that may be applied are to circular bodies, and walls.
Your example would be a bit tricky to do in the current release of Famo.us. I'm not saying it can't be done, but you may want to at least wait for rectangular body collision support.
Famo.us - triggering event and piping

Famo.us - triggering event and piping

By : Alx
Date : March 29 2020, 07:55 AM
will be helpful for those in need You want to use Views built in handlers to achieve this. These are _eventInput and _eventOutput.. Here is an example using an ImageSurface in StripView and responding to a click in AppView..
Hope it helps!
code :
// In StripView.js

var imageSurface = new ImageSurface();

    this._eventOutput.trigger('image-click', { somedata:'some value'} );

// In AppView.js

var stripView  = new StripView();


    // Do Something
Famo.us Pass Event to another view

Famo.us Pass Event to another view

By : user2049358
Date : March 29 2020, 07:55 AM
Any of those help I'm assuming the second `SetListeners' is from NavigationMenuView (instead of AppView as mentioned above)?
I think in AppView, the code should be:
code :
function SetListeners() {
    this.NavigationView.on('settings', function () {
this.on('settings, function () {
    // your code
on collision events in famo.us: How to get bodies involved?

on collision events in famo.us: How to get bodies involved?

By : user3221105
Date : March 29 2020, 07:55 AM
With these it helps I think the answer you're looking for might already be here. And the good news is you were already onto the right thing :) Looking at the Famo.us source code (line 122), the Collision class emits pre/collision/post events along with a collisionData object which contains the source and target bodies of the collision.
Here's an existing answer which demonstrates how to access this data in the collision event.
Related Posts Related Posts :
  • In HTML5, please explain the meaning of '?' in the statement
  • Form to use AJAX rather than a page refresh but also utilise error handling?
  • JQuery Script looping error
  • different size divs align top left
  • Image fade-in when webpage finishes loading
  • Seeking HTML5 audio element causes delay (breaks sync)
  • How can I read & write data to a new tab in Firefox?
  • jQuery or JS turn all words into italic type
  • iOS css -webkit-transform: scale doesn't offset touch events
  • Populate select list using javascript
  • Can you work out why my .js file doesn't seem to be linking to my html?
  • Make slideToggle effect only one element at a time
  • Output sound using JavaScript
  • What is the analytics.js equivalent of _trackPageview found in ga.js
  • How can I check if a JS file has been included already?
  • hasClass and condition not working
  • EDITED: I'm having issues with a button and its function
  • Importing XML in HTML with javascript
  • Create new function in contentScriptFile in Firefox extension
  • Should I build Node.js from source or download the OS X installer?
  • How to enforce integer sizes in JS? (TypeScript?)
  • How to update the JSON object without deleting old values using javascript
  • Reading a javascript variable containing a string into another file
  • Possible to prevent 403 errors from logging to the web console?
  • Jquery Accordion - Expand and collapse div on hover
  • jquery .hide() function - Hide mobile, Display Desktop
  • Holding password in javascript variable - security implications?
  • JQPlot trouble to render vertical stacked bar and horizontal legend
  • counts days inbetween then add class to those days with nested divs?
  • Marionette.js with Rails (Devise) Authentication
  • javascript anonymous function evaluation idiom
  • Why am I losing the decimal when working this equation in Javascript?
  • Site redirects to index.php after being open while making calls to an API using AJAX
  • How to determine when multiple callbacks are all done
  • How to update Yeoman dependencies?
  • How can I do a /resolve with the Soundcloud Javascript SDK?
  • I'm not able to call a named callback function
  • How to get value of Paragraph element contained in <div> in HTML using JavaScript
  • Javascript - Get value from textbox and save it on a string
  • Backbonejs collection not populated, but fetch works
  • when function's internal [[scope]] property is assigned?
  • Wrapping around the edges in a 2d array (game of life)?
  • Clone div with all nested elements along with events in pure javascript
  • How to get response text?
  • Setting and retrieving cookies in javascript
  • Passing parameter with double quotes
  • finding the meaning of the obfuscated javascript
  • Socket.io - Sending data from a pusher stream to the client
  • How to determine the visibility li's in a scrollable ul
  • How to create Scrolling Effect like Grouek website
  • How to display a state in parents template in ui-router
  • Angular ng-repeat - creating collection dynamically
  • finding advertisements on a page with javascript
  • Is there a way to cause a Grunt plugin to fail if input files are missing?
  • JQuery datepickers- setting end date from a start date
  • javascript - explanation request of a behaviour
  • Converting String into date format in JS
  • Choose element Angular
  • Display background grid by using image with CSS
  • Call function from another Controller in another file AngularJS
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org