Skip to content
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

'Physics' was not found in 'vue-babylonjs' #49

Closed
webeswork opened this issue Apr 9, 2019 · 7 comments

Comments

Projects
None yet
2 participants
@webeswork
Copy link

commented Apr 9, 2019

Hi,
I got this error:
'Physics' was not found in 'vue-babylonjs'

The BabylonJs changed?

@BrainBacon

This comment has been minimized.

Copy link
Member

commented Jun 2, 2019

Give the new version a shot and let me now if that works for you now.

@webeswork

This comment has been minimized.

Copy link
Author

commented Jun 3, 2019

Hi,

I use vuebabylonjs here: https://mosaictool.mosaicpic.com/babylon

Houston, we have a problem: :)

I runned the commands:
1: npm install vue-babylonjs
2: npm update
3: npm run dev


ERROR in ./node_modules/vue-babylonjs/dist/esm.js
Module not found: Error: Can't resolve '@babylonjs/core' in 'C:\server\xampp\htdocs\projects\laravel5\laravel_vue_image_mosaic\node_modules\vue-babylonjs\dist'
@ ./node_modules/vue-babylonjs/dist/esm.js 1:0-43 2:0-640
@ ./node_modules/babel-loader/lib?{"cacheDirectory":true,"presets":[["env",{"modules":false,"targets":{"browsers":["> 2%"],"uglify":true}}]],"plugins":["transform-object-rest-spread",["transform-runtime",{"polyfill":false,"helpers":false}]]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./resources/js/components/BabylonphysicsComponent.vue
@ ./resources/js/components/BabylonphysicsComponent.vue
@ ./resources/js/app.js
@ multi ./resources/js/app.js ./resources/sass/app.scss


When I comment out the vuebabylonjs (..., BabylonphysicsComponent.vue) components the Build was successful.

@BrainBacon

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

You need to install @babylonjs/core and @babylonjs/loaders

@webeswork

This comment has been minimized.

Copy link
Author

commented Jun 3, 2019

Thank you!
The Component has been built!


BUT
When I tested my BabylonPhysics component:


<template>
<Scene>
<Camera type="arcRotate" :radius="10" :beta="Math.PI / 4"></Camera>
<HemisphericLight>
<property name="intensity" :float="2"></property>
</HemisphericLight>
<Ground :options="{ width: 10, height: 10 }">
<Physics></Physics>
</Ground>
<Entity v-for="(_, i) in Array(81).fill()" :key="i" :position="[(i % 3) - 1, 2 + Math.floor(i / 9), (Math.floor(i / 3) % 3) - 1]" :scaling="[1, 1, 0.3]">
<Physics :mass="1"></Physics>
<Entity :scaling="[1, 1, 1 / 0.3]">
<Box > </Box>
<Entity :scaling="[-1, 1, 1]">
<Box > </Box>
</Entity>
</Entity>
</Entity>
</Scene>
</template>

<script>

import { Entity, Scene, Box, Material, Texture, HemisphericLight , DirectionalLight, Camera, Ground, Physics } from 'vue-babylonjs';
export default {
components: {
Entity, Scene, Box, Material, Texture, HemisphericLight , DirectionalLight, Camera, Ground, Physics
},
};
</script>


I am sorry but I get the same error:

27:195-202 "export 'Physics' was not found in 'vue-babylonjs'

@BrainBacon

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

Oh, didn't realize you were not using the full install. Try import { Cannon as Physics } instead.

@webeswork

This comment has been minimized.

Copy link
Author

commented Jun 4, 2019

THANK YOU!
It is working! The blocks are falling down! :)

Here is my 'art project' : https://mosaictool.mosaicpic.com/babylonphysics

(At the top "Thanks for Brian Jesse, Vue-BabylonJS! ")

@BrainBacon

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

Glad to hear it works for you now!

@BrainBacon BrainBacon closed this Jun 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.