ConstrainedFlyByCamera is a class that limits how far your camera can look up and down. so that you dont have your player looking all 360 degrees around and confusing himself. its very simple to use, you’ll just have to grab 4 classes from my git hub. i’ve added a link to it below, but note that YOU WILL BE UTTERLY CONFUSED IF YOU DONT READ THE README BEFORE TRYING TO USE IT so, once you click the link, you will see a couple files and a folder. first click the README.txt(or just scroll down), and read up! then you’ll be ready to go into the code folder and follow the instructions from the readme.
Note: i edited this post to make it simpler and more efficient. just in case anyone was wondering.
also, thx to Zarch for suggesting the name ‘ConstrainedFlyByCamera’
Note: to anyone who might commit this to core… I hope we’ve learned our lesson and will do new cameras like this as app states instead of having to have two classes and extra management code.
@thecucumbas said:
EDIT: for some reason it wont let me post the code right. it erases key lines. ive tried every different way of posting the code and it still does it. i have no idea how to fix this :(
For a brief matter of hours, the code plugin handles less than and greater than signs properly but has since reverted to its totally useless current behavior.
To get code to post properly, I think you have to replace all of the less than symbols with ampersand lt semicolon and all of the greater than symbols with ampersand gt semicolon. And make sure you get them all because when you got back to edit it again it will have stripped them out.
@pspeed said:
For a brief matter of hours, the code plugin handles less than and greater than signs properly but has since reverted to its totally useless current behavior.
To get code to post properly, I think you have to replace all of the less than symbols with ampersand lt semicolon and all of the greater than symbols with ampersand gt semicolon. And make sure you get them all because when you got back to edit it again it will have stripped them out.
ah i see. well i never figured that out so i just put the code up on github haha thank you for the reply though! that is very useful information.
but anyways, it should all be fixed up now.
So i added a few classes to the project, and was able to get it working again at around 350-400 fps with some terrain rendered and some bullet physics. i made a jar file so i could easily use it and distribtue, but it simply wont let me use any of the classes in the jar. it recognizes the path but it cant seem to find the classes within. i tried tons of crap but couldnt get it to work, so i opened eclipse cause i wanted to see if it would work there. and it did. so im really really confused ha. is there some special something i have to do to the jar file or manifest to make it act as an API?
Just add the jar to the project in the project settings under “libraries”, then it will be added automatically. Check the manual on project setup and deployment.
@normen said:
Just add the jar to the project in the project settings under "libraries", then it will be added automatically. Check the manual on project setup and deployment.
yeah, i tried that. i also tried addding it by right-clicking the libraries folder in my project and clicking add jar, and also just adding it to an existing jme library. i also tried going tools>ant library>create new library and then adding my jar to the classpath. then i went to my project properties and added the new library to it. but i still get the same results.
say my jar had a class called cucumbas in the directory org.wizard - after adding this to my project(in any of the ways i mentioned above) i can go into code and say:
import org.wizard.*;
^and i get no errors. but it doesnt actually import anything. even though when i look inside the jar i can see the classes in there.
Also, when i try to import a specific class, such as cucumbas:
import org.wizard.cucumbas;
^it says it cannot find it. and again, when i open up the jar file in the project explorer(or extende it, rather) i can see all the classes i need in there. but it still doesnt work for some reason.
yet i add it into an eclipse project and it has no problem finding the classes within the jar. but that doesnt really help cause i need it to work with JME.
@pspeed said:
You see all the classes in there and they are in the proper org/wizard directory structure?
mhmm. i can extend the jar and see its contents in the project explorer if i add it via tools>ant libraries>create new library and then add the library to the project in properties.
and everything looks as expected. all the files are there, in the correct directory and everything.
@thecucumbas said:
mhmm. i can extend the jar and see its contents in the project explorer if i add it via tools>ant libraries>create new library and then add the library to the project in properties.
and everything looks as expected. all the files are there, in the correct directory and everything.
To confirm, “correct directory” means that when you look in the .jar file, you see a “org” directory. Under that there is a “wizard” directory. Under that there is a “cucumbas.class” file.
By the way, I suggest that in the future you may want to follow normal Java naming conventions (ie: Cucumbas for a class name instead of cucumbas) or your stuff will become very hard to read and people will hesitate to help.
@pspeed said:
To confirm, "correct directory" means that when you look in the .jar file, you see a "org" directory. Under that there is a "wizard" directory. Under that there is a "cucumbas.class" file.
By the way, I suggest that in the future you may want to follow normal Java naming conventions (ie: Cucumbas for a class name instead of cucumbas) or your stuff will become very hard to read and people will hesitate to help.
well, actually when i extend it it looks something like this(we’ll call the jar Banana.jar):
banana.jar>
org.wizard>
Cucumbas.class
however, theres actually a few other folders in the jar. like the one that holds the manifest file.
so, when i look in banana.jar, i see the package org.wizard, i dont see a package called org with the wizard package inside it. actually i dont see any org package. the only package is org.wizard
oh and dont worry, i follow the “normal” java naming conventions when im actually coding. i just didnt think to do it in my example cause im just making up the scenario on the fly lol, wasnt trying to confuse
@pspeed said:
Except "org.wizard" is never a valid package directory... but yes, I think he _also_ has a problem with capitals. :)
Yes but I don't have the capital problem in my *actual* jar file. That's what I'm trying to say lol.
And why wouldn’t org.wizard be a valid directory?
When I open up the jme-core library it’s packages are displayed the same way mine is. With . instead of / in between package names.
Am I required to use a certain name for the packages?
Sorry, I’ve never Tryed to make a jar for this reason. I usually only make executable jars.and even then I’ve only done it like 3 times.
Sorry… I forgot that you were using the IDE instead of looking in the actual jar file using a file explorer or something. The IDE already translates paths for you.
Anyway, you keep mixing case here maybe as Normen says you’ve mixed case locally. I don’t think I will trust the information you provide unless you take screen shots now because it is impossible for us to determine which character in your class or package names is actually wrong amidst all of the random typos.