Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@babylonjs/havok

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babylonjs/havok

The Havok physics engine for the web

latest
npmnpm
Version
1.3.10
Version published
Weekly downloads
3.8K
-3.15%
Maintainers
1
Weekly downloads
 
Created
Source

Havok for the Web

This package contains an esm and umd version of the Havok physics library for the web.

How to use

Import havok to your project:

import HavokPhysics from "@babylonjs/havok";

And then initialize the physics engine (inside an async function, or in a modern browser on the main scope):

const havokInterface = await HavokPhysics();

Note that HavokPhysics returns a promise with the initialized engine. You can, of course, use then instead of await if you prefer.

Using the Babylon physics plugin with Havok

Havok is fully integrated in Babylon.js. To use it in a Babylon project, pass it then as the 2nd variable to the Havok physics plugin:

import { PhysicsEngine, HavokPlugin } from "@babylonjs/core/Physics";

const plugin = new HavokPlugin(undefined /* or the value that fits your usecase */, havokInterface);
scene.enablePhysics(undefined /* or the value that fits your usecase, for example: new Vector3(0, -9.81, 0) */, plugin);

And you are good to go!

Questions

The babylon team will be happy to answer any questions! Please contact us at https://forum.babylonjs.com

FAQs

Package last updated on 01 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts