Skip to content

RigidBody's Physcial dimensions not updating with respect to 3D model with animation #655

Description

@ashhadahmd

Description:

I have a 3D model which has an array of animations, the issue I am facing is that the model's animation starts in such a way that the model is flipped closed and after that, it flips open. The model's Physical dimensions are not updating when the model flip opens it stays the way it was before making it go under the collision surface.

Video:

2024-04-11.20-51-49.mp4

Tried Solutions:

I have tried to update the physics by decreasing the timestamp of it getting updated but no results there too.

Source Code:

import { createRoot } from "react-dom/client";
import { Canvas } from "@react-three/fiber";
import { OrbitControls, Center, ContactShadows, Box } from "@react-three/drei";
import { Physics, RigidBody, CuboidCollider } from "@react-three/rapier";
import { Model } from "./models/rover";

export default function App() {
  return (
    <Canvas>
      <OrbitControls />
      <ambientLight intensity={5} />
      <ContactShadows
        scale={20}
        blur={0.4}
        opacity={0.2}
        position={[-0, -1.5, 0]}
      />
      <Physics debug colliders="hull">
        <RigidBody>
          <Center>
            <Model />
          </Center>
        </RigidBody>
        <CuboidCollider position={[0, -2, 0]} args={[20, 1, 20]} />
        <Box args={[40, 2, 40]} position={[0, -2, 0]} />
      </Physics>
    </Canvas>
  );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions