Renewed PULL for merging the branches#2
Conversation
- osg Image Reader/Writer - osg Node Reader/Writer - Off-Screen Rendering (using Pixel Buffer Objects) - wrapper for Vec2/Vec3/Vec4 and their Arrays - extended wrapper for the Matrix - basic classes to construct a renderable object Mesh (Geode, Geometry, ...) - wrapped native functions for texture projection and Raycasting intersection
…works for GLES1 and GLES2
modified: jni/JNIosg.cpp expanded wrapped C++ functionality (functions) in the osg Core domain of the following classes: Node - setTexture - setPointSize - setLineWidth Group - addChild - removeChild - getNumberOfChildren - getChild Camera - setClearColorVec - getClearColorVec - getViewMatrix Vec2 (new) - dispose, create - x,y - set, setX, setY - length, length2 - div, dotProduct, scalarProduct, sum, sub - normalize - negation Matrix - inverse, transpose - scale, mult - get, getTranslation, getRotation - [pre/post]MultVec[3/4] Image - getRed/Green/Blue/Alpha - s,t
modified: src/org/openscenegraph/osg/core/Camera.java
modified: src/org/openscenegraph/osg/core/Group.java
modified: src/org/openscenegraph/osg/core/Image.java
modified: src/org/openscenegraph/osg/core/Matrix.java
modified: src/org/openscenegraph/osg/core/Node.java
expanded Java functionality (functions), which C++ function calls
are previously added, in the osg Core domain of the following classes:
Node
- setTexture
- setPointSize
- setLineWidth
Group
- addChild
- removeChild
- getNumberOfChildren
- getChild
Camera
- setClearColorVec
- getClearColorVec
- getViewMatrix
Vec2 (new)
- dispose, create
- x,y
- set, setX, setY
- length, length2
- div, dotProduct, scalarProduct, sum, sub
- normalize
- negation
Matrix
- inverse, transpose
- scale, mult
- get, getTranslation, getRotation
- [pre/post]MultVec[3/4]
Image
- getRed/Green/Blue/Alpha
- s,t
new file: src/org/openscenegraph/osg/core/Array.java new file: src/org/openscenegraph/osg/core/DrawArrays.java new file: src/org/openscenegraph/osg/core/DrawElementsUInt.java new file: src/org/openscenegraph/osg/core/Drawable.java new file: src/org/openscenegraph/osg/core/Geode.java new file: src/org/openscenegraph/osg/core/Geometry.java new file: src/org/openscenegraph/osg/core/Object.java new file: src/org/openscenegraph/osg/core/PrimitiveSet.java new file: src/org/openscenegraph/osg/core/PrimitiveSetList.java new file: src/org/openscenegraph/osg/core/Texture.java new file: src/org/openscenegraph/osg/core/Texture2D.java new file: src/org/openscenegraph/osg/core/Vec2.java new file: src/org/openscenegraph/osg/core/Vec2Array.java modified: src/org/openscenegraph/osg/core/Vec3.java new file: src/org/openscenegraph/osg/core/Vec3Array.java modified: src/org/openscenegraph/osg/core/Vec4.java new file: src/org/openscenegraph/osg/core/Vec4Array.java added a large collection of Java classes to interface via Android SDK; because the osg::Object is now wrapped, a minor adaptation had to be done for Vec3 and Vec4 in the equals() method
modified: jni/JNIosgViewer.cpp new file: jni/screenview.cpp new file: jni/screenview.h Added newly wrapped C++ functions to allow for off-screen rendering on Android. The screenview class is adapted from the public OSG example. The viewer, formerly just being JNIviewer, is now separated into Viewer and OffScreenViewer, which both inherit from ViewerBase.
modified: src/org/openscenegraph/osg/viewer/OSGRenderer.java new file: src/org/openscenegraph/osg/viewer/OffScreenViewer.java modified: src/org/openscenegraph/osg/viewer/Viewer.java new file: src/org/openscenegraph/osg/viewer/ViewerBase.java Added newly JNI functions and classes to allow for off-screen rendering on Android. The viewer, formerly just being JNIviewer, is now separated into Viewer and OffScreenViewer, which both inherit from ViewerBase. NOTE: just ran an ndk build - errors came up as the normally distributed OSG version apparently doesn't have a RefVec2 (just the way it provides one for Vec3 and Vec4). I know I added it locally to an OSG build (only thing I changed is defining the RefVec2) and submitted it to osg-submissions mailing list. please check in the osg trunk of 3.4 or later if it's there for you - OR: add it as external definition is the JNI headers here. Don't know what's more handy.
modified: jni/Android.mk modified: jni/JNIUtils.h modified: jni/JNIosg.cpp BUG SOLVED: Found the RefVec2 error - I forgot to add it to the JNIUtils (done now). Please check your osg installation if ReferenceType<osg::Vec2> is defined. Also added the screenview.h/cpp to Android.mk to make the OffScreenViewer working. Removed an absurdly large test function for vertex coloring so to remove the request for an interpolation function (added soon). ndk-build compiles now again without errors.
modified: jni/JNIUtils.h Added Interpolate() function
modified: jni/JNIosgDB.cpp Added support (in the C++ wrappers) for using the plugins automatically. Also provided functions for ReadImage, WriteNode and WriteImage.
modified: src/org/openscenegraph/osg/db/ReadFile.java new file: src/org/openscenegraph/osg/db/WriteFile.java Added Java-callable classes (or functions) to read or write a node or an image.
modified: jni/Android.mk modified: jni/JNIosgDB.cpp BUG SOLVED: changed the log message of osgDB to avoid conflicts occurring from the recent addition. Also reverted the Android.mk OSG_HEAD definition to the <path-to....> one.
new file: LICENSE new file: Readme.md Changes not staged for commit: deleted: .classpath deleted: .project Added LICENSE and Readme file as given in the main trunk, and added my name to the contributors. MERGE COMPLETE
Conflicts: org.openscenegraph.android/jni/Android.mk org.openscenegraph.android/jni/JNIosg.cpp org.openscenegraph.android/jni/JNIosgViewer.cpp All conflicts fixed but you are still merging. Changes to be committed: modified: org.openscenegraph.android/Readme.md modified: org.openscenegraph.android/jni/Android.mk modified: org.openscenegraph.android/jni/Application.mk modified: org.openscenegraph.android/jni/JNIUtils.h modified: org.openscenegraph.android/jni/JNIosg.cpp modified: org.openscenegraph.android/jni/JNIosgUtil.cpp modified: org.openscenegraph.android/jni/JNIosgViewer.cpp modified: org.openscenegraph.android/src/org/openscenegraph/osg/util/GeometryUtils.java modified: org.openscenegraph.android/src/org/openscenegraph/osg/viewer/Viewer.java Changes not staged for commit: deleted: org.openscenegraph.android/.classpath deleted: org.openscenegraph.android/.project Merging old head with reverted new history - hope that works on remote
modified: Readme.md deleted: org.openscenegraph.android/LICENSE deleted: org.openscenegraph.android/Readme.md removed confusion on doubled LICENSE and Readme.md
|
Hi @CKehl, Thank you very much for taking the time to redo your PR, we know it has been a hard effort. We will be reviewing it in the next few days. Cheers! |
|
|
||
| ### Static preparation | ||
| OSG_HEAD:=<path-to-osg-gles1-sdk> | ||
| #OSG_HEAD:=/media/christian/DATA/android-osg-sdk/gles1 |
|
@CKehl as a general comment, we were waiting different PR's for different features, not different commits. this way it is easy to use the github interface searching for changes in pull requests. But ok, we will try to review it as is. |
| typedef ReferencedType<osg::Vec4> RefVec4; | ||
| typedef ReferencedType<osg::Quat> RefQuat; | ||
|
|
||
| inline osg::Vec4 Interpolate(osg::Vec2 _texcoord, osg::Image* _img) |
There was a problem hiding this comment.
shouldn't it be "const osg::Vec2 &_texcoord"? Also we tend to use underscore for member class variables, not for parameters.
There was a problem hiding this comment.
I agree Jordi: for efficiency reasons, it can be "const osg::Vec2 &texcoord" - I just needed this function quickly, so I wasn't that picky with the reference. The underscoring: noted and will be changed.
|
Op 06-09-16 om 15:07 schreef Jordi Torres:
How do you go now about the commenting ? should I just erase the |
|
Hi @CKehl, The idea is that you fix yourself your branch, it automatically appears fixed in the PR. Thanks. |
| } | ||
|
|
||
| /* | ||
| JNIEXPORT jlong JNICALL Java_org_openscenegraph_osg_core_PrimitiveSet_nativeCreatePrimitiveSet(JNIEnv *, jclass, jint type, jint mode) |
There was a problem hiding this comment.
Better if we do not leave dead code, if it does not work/serve anymore is better to remove it.
|
Op 06-09-16 om 15:19 schreef Jordi Torres:
well, that was not the way I meant it. I guess I understand you |
| getSize(_gc, width, height); | ||
| if (width!=_width || _height!=height) | ||
| { | ||
| std::cout<<" Window resized "<<width<<", "<<height<<std::endl; |
There was a problem hiding this comment.
rather to use osg::notify mechanism
|
Hey @CKehl, https://help.github.com/articles/about-pull-requests/ So "Once you've created a pull request, you can push commits from your So the only thing you need is to keep adding commits with the fixes to your Does it make sense for you? 2016-09-06 15:27 GMT+02:00 CKehl notifications@github.com:
Jordi Torres |
|
|
||
| getSize(gc, _width, _height); | ||
|
|
||
| std::cout<<"Window size "<<_width<<", "<<_height<<std::endl; |
|
Well seem's at least I have a little read ahead of me :-) But in Op 06-09-16 om 15:37 schreef Jordi Torres:
|
| if(node != NULL) | ||
| node->getOrCreateStateSet()->setAttributeAndModes(lw, osg::StateAttribute::ON); | ||
| } | ||
|
|
There was a problem hiding this comment.
I'm wondering if it would be better to have StateSet abstraction with those methods (including the nativeSetMode), maybe, for now this is ok, but I will open a issue for tracking this change soon.
There was a problem hiding this comment.
Rafa, I agree. But messing with the StateSet wrapping is something I wanted to avoid for now - especially as I usually rather work with geometry, hence more often work with the node concept.
modified: jni/Android.mk Fixed removing comments from Android.mk
cleared the large TextureFromPose-functions.
removed underscored variable names, unnecessary comments and notifications for viewers
modified: screenview.h FINAL FIX: adhered to osg::notify mechanism and remove void statements, pointed out by Jordi.
comment on the changes: the problem why the viewer didn't work was due to the new 3rdParty library setup,
which now appears to work like a charm. An expected error will be raised ONCE with the OpenSceneGraph head,
as it lacks the following functions:
inline void set( value_type x, value_type y ) { _v[0]=x; _v[1]=y; }
inline void set( const Vec2f& rhs) { _v[0]=rhs._v[0]; _v[1]=rhs._v[1]; }
(to be found in <OSG_TOP>/include/Vec2f)
this needs to be patched (currently: manually).
Changes to be committed:
modified: org.openscenegraph.android/jni/Android.mk
modified: org.openscenegraph.android/jni/Application.mk
modified: org.openscenegraph.osgsimple/src/org/openscenegraph/osgsimple/OSGActivity.java
Changes to be committed: modified: org.openscenegraph.android/jni/Android.mk
|
Hey @CKehl, is this ready for the last review and merge? |
|
yes, it is. Just tested it yesterday. Apart from that, it's dead-simple: mkdir build_gles1_obj_armeabi && cd build_gles1_obj_armeabi then modify the paths according to your installation in the Android.mk And you can test it with the osgsimple application you already provided On 20. okt. 2016 13:31, Jordi Torres wrote:
|
Dear osgAndroid team,
we've been mailing each other around half a year ago. Thing is that back then, I made one, big commit and it's hard to cluster/de-cluster all the changes.
On the commit after that (c178f04) I reset back to your old main branch (last commit I had from y'all) (commit: e49ad0d; Fixed Jordi Torres name in the readme). So, from commit c178f04 onwards I commit each change piece-by-piece so you can merge that calmly and easily get back to me if there are errors in the meanwhile.
Kind Regards,
Christian