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

Andy Question #62

Closed
levlups opened this issue Aug 17, 2019 · 4 comments
Closed

Andy Question #62

levlups opened this issue Aug 17, 2019 · 4 comments
Labels

Comments

@levlups
Copy link

levlups commented Aug 17, 2019

first of all amazing work , too good to be true , amazing programming , Andy Im trying to accessMeshParticleSystem library from another part of the script , to be honest with you I dont know nothing about ES6 only javascript , how do we access libraries it puzzles me ,thanks

@fenomas
Copy link
Owner

fenomas commented Aug 18, 2019

Hi, thanks for the kind words!

Let's see, you mean using the brand new ES6 version I pushed like yesterday right? And do you mean the Babylon.js particle system? If so, then I think the steps to be aware of are:

  1. make sure your project has babylon as a dependency
    i.e. npm i --save @babylonjs/core

  2. In your JS, import the specific babylon module:

import { ParticleSystem } from '@babylonjs/core'
console.log(ParticleSystem)

I think that's all there is to it.. but I think Babylon has several different particle systems, and I don't know the details on how they're imported or used.

Does that help?

@fenomas
Copy link
Owner

fenomas commented Aug 18, 2019

PS: if you don't want to mess with granular imports, you may find it easier to do:

import * as BABYLON from '@babylonjs/core'
window.BABYLON = BABYLON

at startup, and then I think you should be able to just reference BABYLON.Mesh.whatever like before.

@levlups
Copy link
Author

levlups commented Aug 18, 2019

sorry I think you misunderstood me , I have been using your engine for a week now , I added NPC and FOG and a watermesh , so your engine is running fine , wath Im trying to do is make the blocksmoke particles collide with terrain .how would I proceed with that

@fenomas
Copy link
Owner

fenomas commented Aug 18, 2019

Ah, I understand now. Noa doesn't have any particular features related to particles. If you're starting from scratch, I believe Babylon has some particle modules or similar - it's a really full-featured 3D engine. Or, if you mean are already working with particles but you need to make them collide with terrain, the basic answer would be to change their position update function to check terrain when they cross a voxel boundary - the function to do that is:

noa.world.getBlockSolidity(x, y, z)

Does that help any?

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

No branches or pull requests

2 participants