Post

Replies

Boosts

Views

Activity

Reply to How to impose an Impulse
Thanks Henry, for such a thorough answer. You illustrate the problem. The last line where you call applyImpulse on physicsBody results in "Value of type 'PhysicsBodyComponent' has no member 'applyImpulse'". That's the challenge I am trying to resolve. Upon what object is applyImpulse supposed to be called on if not physicsBody as you (and I) have defined: guard let physicsBody = tappedObject.entity.components[PhysicsBodyComponent.self] as? PhysicsBodyComponent else { fatalError("PhysicsBodyComponent not found on the entity") } To further clarify, this is a gesture handler that shows the issue: func Throw(objToThrow: EntityTargetValue<TapGesture.Value>) { let entT = objToThrow.entity let comp = entT.components let pbc = comp[PhysicsBodyComponent.self]! let physicsBodComp = pbc as PhysicsBodyComponent // Type casting is unnecessary as pbc is already a PhysicsBodyComponent let impulse = SIMD3<Float>(x: 0.0, y: 10.0, z: 0.0) let position = SIMD3<Float>(x: 0.0, y: 0.0, z: 0.0) let referenceEntity: Entity? = nil physicsBodComp.applyImpulse(impulse, at: position, relativeTo: referenceEntity); // <<< error here } Thanks!
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’23
Reply to How to impose an Impulse
Since the 3 entities are children of Body, applying anything to the parent should (will?) effect the entire thing. Will be easy enough to test, right?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to How to impose an Impulse
Thanks Henry, for such a thorough answer. You illustrate the problem. The last line where you call applyImpulse on physicsBody results in "Value of type 'PhysicsBodyComponent' has no member 'applyImpulse'". That's the challenge I am trying to resolve. Upon what object is applyImpulse supposed to be called on if not physicsBody as you (and I) have defined: guard let physicsBody = tappedObject.entity.components[PhysicsBodyComponent.self] as? PhysicsBodyComponent else { fatalError("PhysicsBodyComponent not found on the entity") } To further clarify, this is a gesture handler that shows the issue: func Throw(objToThrow: EntityTargetValue<TapGesture.Value>) { let entT = objToThrow.entity let comp = entT.components let pbc = comp[PhysicsBodyComponent.self]! let physicsBodComp = pbc as PhysicsBodyComponent // Type casting is unnecessary as pbc is already a PhysicsBodyComponent let impulse = SIMD3<Float>(x: 0.0, y: 10.0, z: 0.0) let position = SIMD3<Float>(x: 0.0, y: 0.0, z: 0.0) let referenceEntity: Entity? = nil physicsBodComp.applyImpulse(impulse, at: position, relativeTo: referenceEntity); // <<< error here } Thanks!
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to "Collisions" missing as option on ParticleEmitter
I don't see it either. I suspect they took it out due to issues. I too would like to detect collisions with particles. Might be a question for DTS. Cheers...
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to Reality Composer Pro crashed when click 'Particle Emitter' button
Same issue here. Would love to see how P.E.'s work. Any ETA on repairs?
Replies
Boosts
Views
Activity
Jul ’23