Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
physics bug fix (#10221)
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField authored May 24, 2024
1 parent 9c477af commit 88bc652
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/engine/src/gltf/GLTFState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
EntityUUID,
getComponent,
getMutableComponent,
getOptionalComponent,
hasComponent,
removeComponent,
removeEntity,
Expand Down Expand Up @@ -484,7 +485,7 @@ const ExtensionReactor = (props: { entity: Entity; extension: string; nodeIndex:
if (!Component) return
return () => {
//check if entity is in some other document and has the component
const uuid = getComponent(props.entity, UUIDComponent)
const uuid = getOptionalComponent(props.entity, UUIDComponent)
const documents = getState(GLTFDocumentState)
for (const documentID in documents) {
const document = documents[documentID]
Expand Down
2 changes: 2 additions & 0 deletions packages/spatial/src/physics/components/ColliderComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { defineComponent, useComponent, useEntityContext } from '@etherealengine
import { getState } from '@etherealengine/hyperflux'

import { useAncestorWithComponent } from '../../transform/components/EntityTree'
import { TransformComponent } from '../../transform/components/TransformComponent'
import { Physics } from '../classes/Physics'
import { CollisionGroups, DefaultCollisionMask } from '../enums/CollisionGroups'
import { PhysicsState } from '../state/PhysicsState'
Expand Down Expand Up @@ -80,6 +81,7 @@ export const ColliderComponent = defineComponent({
reactor: function () {
const entity = useEntityContext()
const component = useComponent(entity, ColliderComponent)
useComponent(entity, TransformComponent)
const rigidbodyEntity = useAncestorWithComponent(entity, RigidBodyComponent)

useEffect(() => {
Expand Down

0 comments on commit 88bc652

Please sign in to comment.