We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Vector library conflict with traer's physics
Page Index Toggle Pages: 1
Vector library conflict with traer's physics? (Read 510 times)
Vector library conflict with traer's physics?
May 7th, 2008, 1:45am
 
I started an app that uses daniel shiffman's Vector3D library for vector stuff (obviously), then I decided to add some particle physics to the app and imported traer's physics library. Now I get this error:

"Type 'Vector3D' is imported on demand from package 'noc' and package 'traer.physics'"

I took this to mean that traer's library included the vector3d library, but this is not true; the code fails to run because variable names are not the same, and some variables are actually functions in traer's physics' library. Does traer's physics library have shiffman's Vector3D library built into it, or something else entirely? If the latter, where is the documentation for this?
Re: Vector library conflict with traer's physics?
Reply #1 - May 7th, 2008, 10:25am
 
traer's Vector3Ds are different to shiffman's unfortunately, so they're not interchangeable.

You can get around the difference by using the fully qualified name, e.g.
Code:
traer.physics.Vector3D foo=new traer.physics.Vector3D(...);
noc.Vector3D bar=new noc.Vector3D(...);
//etc


As long as you remember which variable is which type you can use both, you just can't pass a traer.physics one into a noc function or vice-versa.
Re: Vector library conflict with traer's physics?
Reply #2 - May 10th, 2008, 6:55pm
 
Alternatively, you might want to avoid import traer.physics.*; in favor to more aimed imports.
(not tested, didn't looked at the libraries...)
Page Index Toggle Pages: 1