logo

Fysics TypeScript Physics Engine

Marco Kammer

Marco Kammer / August 7, 2022

Typescript physics engine for kings

Introduction

Fysics is 2D and 3D physics engine made in purely typescript…

description

ToDO

  • intro to it
  • some examples
  • next steps to work on

Body

RigidBody

Is solid body that doesn’t defor or might slightly but it is barely noticeable. Usually used in character controllers

basic React setup

import {RigidBody} from 'fysics/2d'
import {RigidBody} from 'fysics/3d'

function Character2d(){

    return(
        <RigidBody shape='Capsule' mass='1'>
            <Sprite />
        </RigidBody>
    )
function Character3d(){

    return(
        <RigidBody shape='Capsule' mass='1'>
            <3DModel />
        </RigidBody>
    )
}

SoftBody

Is focused on visually realistic physical simulations of the motions and properties of deformable objects.

basic React setup

import { SoftBody } from 'fysics/2d';
import { SoftBody } from 'fysics/3d';

function Slime2d() {
  return (
    <SoftBody shape='Box' mass='1'>
      <Box2d />
    </SoftBody>
  );
}

function Slime3d() {
  return (
    <SoftBody shape='Box' mass='1'>
      <Box3d />
    </SoftBody>
  );
}