Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [RFE] - Common Math (vectors, matrices, etc) Stuff  (Read 3785 times)
0 Members and 1 Guest are viewing this topic.
Offline arielsan
« Posted 2011-04-25 16:44:59 »

Hi guys, I was wondering if all java gaming libraries could join forces and create a common Math library for vectors/matrices/transformations/etc stuff.

All implementations (phys2d, jbox2d, slick2d, libgdx, lwjgl-utils, etc) seems to be very similar and to have similar stuff. If all of them work together, we could have a common and better math library.

Vecmath seems interesting to be modified for the greater good but only jbullet is using it, also I dunno about its license.

What do you think?

Offline jezek2
« Reply #1 - Posted 2011-04-26 04:08:44 »

All implementations (phys2d, jbox2d, slick2d, libgdx, lwjgl-utils, etc) seems to be very similar and to have similar stuff. If all of them work together, we could have a common and better math library.

Vecmath seems interesting to be modified for the greater good but only jbullet is using it, also I dunno about its license.

Vecmath API (there is BSD or so licensed reimplementation btw) is closest to best candidate for two reasons: it is somewhat official (but quite weak to be honest) and technically probably the best you can achieve in Java. And we've tried, me and other devs to come with a better API.

I don't think such unification will happen as everyone has their opinions and it's easier and more coherent to port everything including vector/matrix/etc. routines in ported libraries.

However, in an unlikely event if there would be some evolved vecmath API (basically just added stuff to vecmath api and in unofficial package) and have support in other java gamedev libraries, I would most likely adapt JBullet to it.
Offline arielsan
« Reply #2 - Posted 2011-04-26 16:27:57 »

When I worked on jsnakes, I used jbullet for the physics and I remember using vecmath and it has a lot of useful methods in the API but also IMO has a lot of not related stuff in some of its classes. Btw, I found an updated copy of vecmath on github, dunno if the github project's author is related to the original code.

I am agree that the unification could never happen, but we have to try. Maybe we could start by defining only an API, not an implementation, so we could at least use the same methods: distance() or dst(), length and lengthSquared or len() and len2(), etc. Then ppl could implement them using the implementation they want (fast, ultra fast, using native code, etc).


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline cylab

JGO Knight


Medals: 34



« Reply #3 - Posted 2011-04-26 17:24:06 »

> updated vecmath... BSD reimplementation...

take a look at openmali (http://java.net/projects/openmali/)

Mathias - I Know What [you] Did Last Summer!
Offline lhkbob

JGO Knight


Medals: 32



« Reply #4 - Posted 2011-04-26 17:48:07 »

The biggest thing that the vecmath libraries are missing (unless its been added recently) is that there is no support for read-only or immutable types.  It is really useful to be able to return a vector that won't change on you without needing to make a defensive copy.

Offline arielsan
« Reply #5 - Posted 2011-04-26 20:41:46 »

@lhkbob

Same approach libgdx and slick2d uses I believe (dunno about jbox2d Vec2 or Vector2f from LWJGL-util). One thing to notice is they have a tmp() and cpy() methods to return a temporary or new vector (respectively) with the values of the current vector. Maybe that could be an addition to vecmath (or other library).

All these libraries use this approach for a performance reason by avoiding making billions of new instances and killing the GC (which sucks on the Android platform for example). I like the approach but I also like easy to use APIs.

@cylab

I took a look at openmali, seems like vecmath plus a looooooooooooot of stuff (even collision stuff) (I also took a look at commons-math from apache and I have the same opinion). I believe the smaller the common math library is, greater chances of ppl using it. However, I also believe that multiple common math library modules could be made.


Offline jezek2
« Reply #6 - Posted 2011-04-26 21:21:38 »

You can see my conclusion from 2008 regarding openmali and generally about vecmath libraries in Java.

Unless you can come with something new, this was already resolved. The only thing that could be improved is to make more projects using Sun's Vecmath. However in some projects this is no issue, eg. in JMonkeyEngine you work with JME vecmath and jbullet or other physics engines are behind abstraction so the conversion is done in JME itself.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (51 views)
2014-04-15 18:08:23

BurntPizza (48 views)
2014-04-15 03:46:01

UprightPath (63 views)
2014-04-14 17:39:50

UprightPath (45 views)
2014-04-14 17:35:47

Porlus (62 views)
2014-04-14 15:48:38

tom_mai78101 (86 views)
2014-04-10 04:04:31

BurntPizza (146 views)
2014-04-08 23:06:04

tom_mai78101 (243 views)
2014-04-05 13:34:39

trollwarrior1 (202 views)
2014-04-04 12:06:45

CJLetsGame (209 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!