Skip to content

Add Shockwave effect #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
talentlessguy opened this issue Aug 8, 2020 · 3 comments · Fixed by #179
Closed

Add Shockwave effect #25

talentlessguy opened this issue Aug 8, 2020 · 3 comments · Fixed by #179
Labels
enhancement New feature or request

Comments

@talentlessguy
Copy link
Member

talentlessguy commented Aug 8, 2020

docs reference: https://vanruesc.github.io/postprocessing/public/docs/class/src/effects/ShockWaveEffect.js~ShockWaveEffect.html

@talentlessguy talentlessguy added the enhancement New feature or request label Aug 8, 2020
@talentlessguy
Copy link
Member Author

it breaks at the moment due to this:

Uncaught TypeError: camera.getWorldDirection is not a function
    update postprocessing.esm.js:4786
    render postprocessing.esm.js:2378
    render postprocessing.esm.js:2796
    _c EffectComposer.tsx:65
    render$1 react-three-fiber.esm.js:862
    loop react-three-fiber.esm.js:884
    loop react-three-fiber.esm.js:881
    loop react-three-fiber.esm.js:889
    loop react-three-fiber.esm.js:889
    loop react-three-fiber.esm.js:889
    loop react-three-fiber.esm.js:889
    loop react-three-fiber.esm.js:889
    loop react-three-fiber.esm.js:889
    loop react-three-fiber.esm.js:889
    loop react-three-fiber.esm.js:889
    loop react-three-fiber.esm.js:889
    loop

even when you pass camera thru useThree it still says that, despite having the missing method

dk what's the issue

@netgfx
Copy link

netgfx commented Mar 26, 2022

Same here tried to manually explode it but it throws the above error. Any ideas?

@CodyJasonBennett
Copy link
Member

Noticed this from a question. Effect passes usually require a camera as the first constructor argument, then a list of parameters:

import { forwardRef } from 'react'
import { extend, useThree } from '@react-three/fiber'
import { ShockWaveEffect } from 'postprocessing'

extend({ ShockWaveEffect })

const ShockWave = forwardRef(function ShockWave({ args = [], ...props }, ref) {
  const camera = useThree((state) => state.camera)
  return <shockWaveEffect {...props} ref={ref} args={[camera, ...args]} />
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants