Having trouble getting the physics engine to work with WebGL ThreeJS and PhysiJS in angularJS?

Currently, I am conducting Webgl experiments using ThreeJS and PhysiJS while integrating them into angularJS. However, I am facing an issue where the gravity is not being applied properly. You can refer to an example of this problem here:

Upon checking the console, I noticed multiple errors:

gl.getProgramInfoLog() warning: Variable sampler array index unsupported.
This feature was removed in GLSL 1.20 and may not be supported for 1.10 in Mesa.

Although I initially believed this error to be a bug on my GPU, it seems to be just a warning rather than an error. https://github.com/mrdoob/three.js/issues/4507

I encountered two "undefined is not a function" calls. The file containing the Physics implementation is located here:

https://github.com/vimes1984/spiro/blob/master/scripts/controllers/spiro_eight.js

Due to my limited knowledge of webworkers, I am unable to resolve this issue. Could someone provide guidance or explain why it's not functioning as expected?

Answer №2

If you're looking for a simple API that already wraps everything up, check out WhitestormJS. You can find the project here and their documentation on their website. WhitestormJS has made improvements to physics as well, moving away from Physi.js which uses an older version of Ammo.js.

P.s.: The newest version also includes a softbody feature. Hopefully, this will be helpful for you!

Here are some examples:

  • FPS / Shooter (First person example with special effects and terrain)
  • Physics / Dominos (Physics example with dominos)
  • Performance / Sticks (Demonstrating collision performance with basic box objects)
  • Basic / Softbody (Simple implementation of softbody physics)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to save array data to a text file using node.js

I have an array containing values that I want to write to a text file using the following code. while(filedataarr.length>0) { firstelement = filedataarr.shift(); //console.log(firstelement); fs.appendFile("D:\\Temp& ...

Changing a variable with Functions and Objects

I'm curious to know what the index variable returns in this code snippet. I believe it will be 0. function jsTest() { var index = 0; var counter = 0; var obj = {}; obj.index = index; var func = function () { for (index ...

Creating a system to add and limit dynamic fields with a counter in jQuery

Check out this fiddle link http://jsfiddle.net/gKJEs/80/ I'm looking for a way to limit the number of rows that can be added, let's say up to 5. Here is the HTML code: <table id="table"></table> <button id="addRowBtn">Add Ro ...

Using a Spinner Component in ASP.NET MVC

When the page needs to perform an action, such as fetching data from a database, I want to display a spinner. Once the action is complete, I want to hide the spinner. To achieve this, I decided to define the following in my Layout.cshtml: <div id="Spin ...

Getting rid of the empty spaces between the lines of cards in Bootstrap 4

I want to eliminate the vertical space between the cards in my layout. Essentially, I want the cards to maximize the available space. I am open to using a plugin if necessary, but I have not been able to find any relevant information online (maybe I used t ...

Having trouble showing Bootstrap Toasts on my website

I successfully implemented Toast functionality upon button click, but I am facing an issue where I have two buttons and I want a separate Toast to appear for each button click. How can I achieve this? Another problem I encountered is related to the docume ...

Issue encountered while attempting to synchronize the protractor with the webpage: "Unable to access property 'get' of undefined"

When I access my test target page, it has a Single Sign-On (SSO) integrated login system. After hitting the page, a SSO-integrated Windows authentication process takes place before redirecting to the home page. I attempted to disable Sync for the first te ...

Issues with navigating jQuery UI links while offline in Google abound

Hello, I am a newcomer to jQuery and I am facing an issue with my code. I added the <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> but for some reason, my jQuery is not working. I have tried searching ...

Listening for a client's socket emit through Express Routes

I have successfully implemented the functionality to emit and receive messages using socket.io between the server and client with the code in server.js. const express = require('express') const app = express() const port = 4000 var http = require ...

Is it possible to modify a JavaScript array variable without having to refresh the page by utilizing Ajax?

Is it possible to update a JavaScript array variable without having to reload or refresh the page? I have an existing list of data in an array, and I retrieve additional data using PHP and Ajax. Now I want to add the new data obtained from PHP Ajax to th ...

Discover the secrets of positioning objects around a spherical globe in Three.js

I am currently working on a project where I have a json file containing country borders. My goal is to use this data to build a map in three.js, similar to the example provided by this link. I want each cylinder on the map to be positioned according to i ...

How can I dynamically switch the visibility of div elements based on their class and name attributes?

I am currently in the process of dynamically generating a Table of Contents. Levels of Hierarchy: Parent Division Children Division Grandchildren Division To achieve this, I am dynamically creating div elements. Following which, I am assigning ma ...

Creating a specialized directive for dynamically populating a select box in AngularJS

In the controller below, an HTTP GET service is called and the data is assigned to a scope variable named show_data: .controller('forms_controller', function($scope, Form) { Form.get().then(function(data){ $scope.show_data = data; }); }); ...

Setting up jsonServer in gulp with typescript: A guide

Previously, I had set up a json server and used the following code to start it: I found guidance in this GitHub repository. Starting angular2 project with gulp gulp-live-server.js var gulpCore = require('gulp'); var gulpParam = require('g ...

Enhancing Highcharts with realtime data streams using Socket.io

I'm currently working on a dashboard project utilizing node.js, socket.io, and highcharts. My main objective is to have the chart update in real-time upon receiving a request from socket.io. Does anyone have any suggestions on how to achieve this? ...

The React Router path is inaccurately matching to a different route

I'm currently utilizing React version 4.2 for my application, but it appears to be having trouble matching the correct paths for the routes. <Provider store={store}> <BrowserRouter> <div> <Switch> ...

When the page changes during rendering, the pagination triggers the handlePageClick function upon page loading

I am a beginner in React.js and I am facing an issue with my React pagination. The handlePageClick function is getting called automatically when the page loads instead of triggering only when the user clicks. Below is the code snippet: export default clas ...

Retrieving checkbox list values using jQuery

I am working with a div that contains some checkboxes. I want to write code so that when a button is clicked, it will retrieve the names of all the checked checkboxes. Can you provide guidance on how to achieve this? <div id="MyDiv"> .... <td> ...

Prevent Vue.js text input from displaying the v-model value

How can I prevent an input from displaying the value of its pre-defined v-model in Vue.js? For instance, suppose I have an input with "value" as its v-model, which has already been set elsewhere in the code. I would like to avoid showing this "value" ins ...

Gather the URLs from the sitemap and use cy.request() to test each individual URL in Cypress

Using TypeScript with Cypress for URL extraction. I have a code objective to extract and validate all URLs in the /sitemap.xml file using cy.request() to check for a status of 200. The initial version successfully achieves this: describe('Sitemap Ur ...