Package apple.glkit
Class GLKSkyboxEffect
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.glkit.GLKSkyboxEffect
-
- All Implemented Interfaces:
GLKNamedEffect,NSObject
public class GLKSkyboxEffect extends NSObject implements GLKNamedEffect
GLKSkyboxEffect GLKSkyboxEffect implements common skybox functionality as is used by many of todays games and simulations. A skybox is a textured cube that encloses the boundaries of the object space of a 3D graphics application or game. It provides a visual horizon in all camera directions within 3D object space. GLKSkyboxEffect requires at least an OpenGL ES 2.0 context on iOS and an OpenGL Core Profile context on OS X. This context must be initialized and made current prior to creating or initializing GLKSkyboxEffect instances. No OpenGL context state settings are modified when a GLKSkyboxEffect instance is created or its properties set. When -[GLKSkyboxEffect prepareToDraw] is called it modifies the following state: GL_CURRENT_PROGRAM GL_TEXTURE_BINDING_CUBE_MAP GL_VERTEX_ARRAY_BINDING_OES GL_ARRAY_BUFFER_BINDING GL_VERTEX_ATTRIB_ARRAY_ENABLED (GLKVertexAttribPosition) For performance reasons GLKSkyboxEffect does not restore any of these state settings. It is up to the client application to save/restore/set these state elements as they choose. A cube mapped texture name must be provided to GLKSkyboxEffect to provide it texture data for the 6 faces of the skybox cube. Care must be taken when preparing the cubemap texture to prevent seams from appearing at the interfaces between adjacent faces. Unlike other named effects, GLKSkyboxEffect provides a -draw method and requires no ancillary vertex attribute setup because the class maintains the simple, unambiguous geometry data required to draw the skybox internally. The following (4) steps are required to use GLKSkyboxEffect: (1) Allocate and initialize an instance of GLKSkyboxEffect skybox = [[GLKSkyboxEffect alloc] init]; (2) Create a cube map texture for the skybox glGenTextures(1, &cubeMapName); glBindTexture(GL_TEXTURE_CUBE_MAP, cubeMapName); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); GLenum cubeMapBase = GL_TEXTURE_CUBE_MAP_POSITIVE_X; for(face = 0; face < 6; face++) glTexImage2D(cubeMapBase + face, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, faceData[face]); (3) Configure the skybox effect transform, location, size, and texture properties skybox.center = center; skybox.xSize = xSize; skybox.ySize = ySize; skybox.zSize = zSize; skybox.textureCubeMap = cubeMapName; // created in step (2) above (4) For each frame drawn: Update properties that change per frame. Synchronize the changed effect state by calling -[GLKSkyboxEffect prepareToDraw]. Draw the the skybox. skybox.transform.modelviewMatrix = modelviewMatrix; [skybox prepareToDraw]; [skybox draw];
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGLKSkyboxEffect(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static GLKSkyboxEffectalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)GLKVector3center(){ 0.0, 0.0, 0.0 }static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()voiddraw()Draw skyboxstatic longhash_static()GLKSkyboxEffectinit()static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)java.lang.Stringlabel()nilstatic java.lang.Objectnew_objc()voidprepareToDraw()static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsetCenter(GLKVector3 value){ 0.0, 0.0, 0.0 }voidsetLabel(java.lang.String value)nilstatic voidsetVersion_static(long aVersion)voidsetXSize(float value)1.0, 1.0, 1.0voidsetYSize(float value)1.0, 1.0, 1.0voidsetZSize(float value)1.0, 1.0, 1.0static org.moe.natj.objc.Classsuperclass_static()GLKEffectPropertyTexturetextureCubeMap()name == 0, target == GL_TEXTURE_CUBE_MAPGLKEffectPropertyTransformtransform()Identity for all matricesstatic longversion_static()floatxSize()1.0, 1.0, 1.0floatySize()1.0, 1.0, 1.0floatzSize()1.0, 1.0, 1.0-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static GLKSkyboxEffect alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
center
public GLKVector3 center()
{ 0.0, 0.0, 0.0 }
-
draw
public void draw()
Draw skybox
-
init
public GLKSkyboxEffect init()
-
label
public java.lang.String label()
nil
-
prepareToDraw
public void prepareToDraw()
- Specified by:
prepareToDrawin interfaceGLKNamedEffect
-
setCenter
public void setCenter(GLKVector3 value)
{ 0.0, 0.0, 0.0 }
-
setLabel
public void setLabel(java.lang.String value)
nil
-
setXSize
public void setXSize(float value)
1.0, 1.0, 1.0
-
setYSize
public void setYSize(float value)
1.0, 1.0, 1.0
-
setZSize
public void setZSize(float value)
1.0, 1.0, 1.0
-
textureCubeMap
public GLKEffectPropertyTexture textureCubeMap()
name == 0, target == GL_TEXTURE_CUBE_MAP
-
transform
public GLKEffectPropertyTransform transform()
Identity for all matrices
-
xSize
public float xSize()
1.0, 1.0, 1.0
-
ySize
public float ySize()
1.0, 1.0, 1.0
-
zSize
public float zSize()
1.0, 1.0, 1.0
-
-