yarn : 无法加载文件 d:\nodejs\yarn.ps1,因为在此系统上禁止运行脚本。

 分类:Android, Java, Others, Others 阅读 (714)  yarn : 无法加载文件 d:\nodejs\yarn.ps1,因为在此系统上禁止运行脚本。已关闭评论
1月 122023
 

执行yarn android出现如下错误

解决办法:

  1. 打开“开始”菜单,搜索powershell,在powershell菜单上右键,点击“以管理员身份运行”
  2. 在打开的powershell命令行窗口中输入get-ExecutionPolicy,可以查看返回的是Restricted,这个意思是管理员权限是禁用的
  3. 在命令行窗口中输入set-ExecutionPolicy remotesigned,按照提示输入y,回车,就可以执行yarn相关命令了
 Posted by on 2023-01-12

MediaRecorder方法属性详解

 分类:Android, Java 阅读 (1,612)  MediaRecorder方法属性详解已关闭评论
6月 282022
 

基本Android sdk28版本编写

一、方法

setMaxDuration(int max_duration_ms)

  设置最大录像时长(单位:毫秒),需要在setOutFormat()之后prepare()之前调用。当录像时长达到这个时长,将触发MediaRecorder.OnInfoListener事件,事件的what参数为MEDIA_RECORDER_INFO_MAX_DURATION_REACHED,并且录像停止。停止动作是异步执行的,不能保证收到OnInfoListener时停止操作已完成。

setMaxFileSize(long max_filesize_bytes)

  设置最大录像文件大小(单位:字节),需要在setOutFormat()之后prepare()之前调用。当录像时长达到这个时长,将触发MediaRecorder.OnInfoListener事件,事件的what参数为MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED,并且录像停止。停止动作是异步执行的,不能保证收到OnInfoListener时停止操作已完成。

setNextOutputFile(File file)

  当setOutputFile或者setNextOutputFile所设置的输出文件达到最大文件尺寸时,使用此函数设置下一个输出文件。文件应该是可查找的(seekable)?当设置了next output file后,程序在调用mediarecorder.stop之前不要使用这个文件。程序应该在收到what参数为MEDIA_RECORDER_INFO_MAX_FILESIZE_APPROACHING的OnInfoListener事件之后,what参数为MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED的OnInfoListener之前调用setNextOutputFile函数。当收到what参数为MEDIA_RECORDER_INFO_NEXT_OUTPUT_FILE_STARTED的OnInfoListener事件后,此函数设置的文件才开始被录制。当之前设置的文件未被使用时,是不能设置新的输出文件的。当调用stop停止录像时,程序负责清理未使用的文件。

setPreviewDisplay(Surface sv)

  设置一个Surface用于预览正在录制的视频。需要在prepare函数前调用此函数。

  如果使用了setCamera(camera),并且camera对象已经设置了surface,程序就不用再调用此函数设置surface了,如果使用了一个非null值的surface作为参数调用了此函数,camera的预览surface将被新设置的surface代替;如果根本没有调用此函数或者传入了一个为null的surface,media recorder不会改变camera的surface。

 Posted by on 2022-06-28

Android开发使用js在webview中模拟登录

 分类:Android, Java 阅读 (1,396)  Android开发使用js在webview中模拟登录已关闭评论
2月 172022
 

1.首先要设置setJavaScriptEnabled为true,使用webview支持js

2.使用js脚本的document.getElementById找到用户名和密码输入框,并模拟输入用户名和密码的内容,然后找到提交按钮并模拟click点击。注意:js必须写成一个函数(示例代码中的jsLogin函数)运行。

 

Android支持的传感器类型

 分类:Android, Java 阅读 (1,917)  Android支持的传感器类型已关闭评论
12月 302021
 

SensorEvent使用的系统坐标系

TYPE_ACCELEROMETER = 1;

加速度计。

TYPE_ACCELEROMETER_UNCALIBRATED = 35;

无标定加速度计。

TYPE_AMBIENT_TEMPERATURE = 13;

环境温度。values[0]代表环境的摄氏温度。

TYPE_DEVICE_PRIVATE_BASE = 65536;

设备私有传感器定义范围基础值。

TYPE_GAME_ROTATION_VECTOR = 15;

游戏旋转向量

TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20;

TYPE_GRAVITY = 9;

重力。

TYPE_GYROSCOPE = 4;

陀螺仪。对应值表示设备沿x, y, z三轴旋转的速度(弧度/秒),逆时针旋转时值为正

values[0]: Angular speed around the x-axis
values[1]: Angular speed around the y-axis
values[2]: Angular speed around the z-axis

TYPE_GYROSCOPE_UNCALIBRATED = 16;

TYPE_HEART_BEAT = 31;

TYPE_HEART_RATE = 21;

TYPE_LIGHT = 5;

环境亮度。

TYPE_LINEAR_ACCELERATION = 10;

线性加速度。表示沿设备各个轴的线性加速度值,已去除重力的影响。单位m/s^2,坐标系和加速度计的相同。

加速度计、重力和线性加速度计需要满足下面的公式

加速度=重力+线性加速度

TYPE_LOW_LATENCY_OFFBODY_DETECT = 34;

TYPE_MAGNETIC_FIELD = 2;

 

TYPE_MAGNETIC_FIELD_UNCALIBRATED = 14;

TYPE_MOTION_DETECT = 30;

TYPE_ORIENTATION = 3;

横滚角-roll、俯仰角-pitch、偏航角-yaw

返回值的单位为度

  • values[0]:方位角,磁场北极和y轴的夹角,其实就是沿z轴的旋转角度(范围:0-359),0-正北,90-正东,180-正南,270-正西。
  • values[1]:俯仰角,手机沿x轴的旋转角度,范围-180-180度,手机头朝下旋转时为正值,手机头朝上旋转时为负值
  • values[2]:横滚角,手机沿y轴的旋转角度,范围-90-90度,逆时针旋转为正值,顺时针旋转为负值

TYPE_POSE_6DOF = 28;

TYPE_PRESSURE = 6;

values[0]表示大气压,单位hPa(百帕)

TYPE_PROXIMITY = 8;

TYPE_RELATIVE_HUMIDITY = 12;

TYPE_ROTATION_VECTOR = 11;

TYPE_SIGNIFICANT_MOTION = 17;

TYPE_STATIONARY_DETECT = 29;

TYPE_STEP_COUNTER = 19;

TYPE_STEP_DETECTOR = 18;

https://developer.android.google.cn/reference/android/hardware/SensorEvent

 Posted by on 2021-12-30

Installation failed with messag failed to commit install session….

 分类:Android, Java 阅读 (3,097)  Installation failed with messag failed to commit install session….已关闭评论
12月 282021
 

使用Android Studio在三星Galaxy Tab S7(Android 11)上调试应用时出现如下错误

Installation failed with messag failed to commit install session 1992275399 with command cmd package install-commit 1992275399. Error: INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed parse during installPackageLI: Failed to read manifest from /data/app/vmdl1992275399.tmp/split_lib_slice_9_apk.apk: null. 

It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

点击ok后,提示DELETE_FAILED_INTERNAL_ERROR.

解决办法:后来把应用的targetSdkVersion由32改为28就可以安装了。

 Posted by on 2021-12-28

jPCT-AE Virtualizer对象属性方法详解

 分类:Android, Java 阅读 (665)  jPCT-AE Virtualizer对象属性方法详解已关闭评论
12月 222021
 

Virtualizer可以协助将对象存储到磁盘中,以节省内存使用。要使用此对象应确保app可以访问存储系统,并且有足够的空间。

 Posted by on 2021-12-22

jPCT-AE Object3D对象属性方法详解

 分类:Android, Java, Uncategorized 阅读 (1,254)  jPCT-AE Object3D对象属性方法详解已关闭评论
12月 222021
 
  • Constructor Detail

    • Object3D

      Constructor for creating an Object3D out of indexed geometry in bulk form. This can be useful to create an Object3D at once from data loaded by one’s own file loader.
      Parameters:
      coordinates – the coordinates [x1,y1,z1,x2,y2,z2,…]
      uvs – the texture coordinates [u1,v1,u2,v2,…]
      indices – the indices indexing the tuples/triples in the coordinate arrays
      textureId – the texture id. If not known, just use TextureManager.TEXTURE_NOTFOUND
    • Object3D

      Constructor for creating an Object3D out of indexed geometry in bulk form. This can be useful to create an Object3D at once from data loaded by one’s own file loader.
      Parameters:
      coordinates – the coordinates [x1,y1,z1,x2,y2,z2,…]
      normals – the vertex normals [nx1,ny1,nz1,nx2,ny2,nz2,…]
      uvs – the texture coordinates [u1,v1,u2,v2,…]
      indices – the indices indexing the tuples/triples in the coordinate arrays
      textureId – the texture id. If not known, just use TextureManager.TEXTURE_NOTFOUND
    • Object3D

      创建一个新的Object3D对象实例。通常,创建一个对象是为了添加到world实例中。你也可以创建假的Object3D实例,只是为了带着他的一些子对象进行一个移动或者旋转等做变换,这种作方也可以通过createDummyObj()方法来实现。
      参数:
      maxTriangles – 此对象可包含的最大的三角形的数量(超出数量会提示ERROR: Polygon index out of range – object is too large!).
    • Object3D

      This constructor works similar to cloneObject() but it allows to extend Object3D and still use the static methods from Loader/Primitives by adding a call to super(Object3D) in the constructor of your class. Consider this to be a kind of “workaround” for the fact that you can’t extend a loaded (by Loader) or created (by Primitives) Object3D directly. Please note that this doesn’t work on stripped objects until you set their meshes to locked.
      Parameters:
      obj – the Object3D to construct this Object3D from
    • Object3D

      This constructor works similar to cloneObject() but it allows to extend Object3D and still use the static methods from Loader/Primitives by adding a call to super(Object3D) in the constructor of your class. Consider this to be a kind of “workaround” for the fact that you can’t extend a loaded (by Loader) or created (by Primitives) Object3D directly.Please note that this doesn’t work on stripped objects until you set their meshes to locked.
      Parameters:
      obj – the Object3D to construct this Object3D from
      reuseMesh – if true, the new object will use the same mesh

  • Method Detail

    • createDummyObj

      相当于new Object3D(0);创建一个假的Object3D对象。这个仿制品是一个空白的3d对象。此方法用于创建的对象一般不会被添加到world实例,通常作为一个child对象与另外一个3D对象关联。这对增加对象绑定的稳定性很有用(比如月亮围着一个行星旋转,通过在行星中心放一个假的对象并与月亮对象进行关联很有用。这样可以同时实现行星的自转和月亮对行星的公转?)通过没有必要也没用将此对象添加到world中的应用场景。
      Returns:
      a dummy Object3D
    • setVirtualizer

      Sets a virtualizer for this object’s geometry. By default, none is set.
      Parameters:
      virtualizer – the virtualizer
    • getVirtualizer

      Returns the current Virtualizer. By default, none is set.
      Returns:
      the virtualizer or null
    • setUserObject

      当你不想(或者不能)对Object3D对象做一些扩展的时候,这是一个给Object3D添加额外信息的变通的方法。
      Parameters:
      obj – Object whatever you like…
    • setSortOffset

      Sets on offset for the z-Sorting. Usually this is not needed, but it could be helpful for transparent objects that are sorted incorrectly otherwise.
      Parameters:
      offset – the offset
    • mergeObjects

      Static method that merges two objects into a third one. This should be done before calling build() on any of these objects and it does not copy other properties of the object (like rendering modes etc…).
      Merging objects is quite expensive in terms of memory usage. Merged objects are not compressed by default.
      Parameters:
      first – the first object to merge
      second – the second object to merge
      Returns:
      the merged object
    • mergeAll

      Merges all objects in the array into one large object. The array will be empty afterwards.
      Parameters:
      objs – the objects
      Returns:
      the merged result
    • resetNextID

      Resets the internal object-counter.
    • getNextID

      Static method that returns the ID the next object will get. This is useful to know if (and only if) you want to serialize your world, because this value isn’t serialized by default.
      Returns:
      the ID
    • setNextID

      Sets the ID the next object will get. It has to be higher than the current one. This method can be used to deserialize a world. Be careful when using this method, because screwing up the IDs will most likely screw up everything else.
      Parameters:
      next – the next ID
    • compile

      Mainly needed to ease porting from the desktop version of jPCT. By default, jPCT-AE does this call automatically, so usually there’s no need to call this method directly.
    • compile

      Mainly needed to ease porting from the desktop version of jPCT. By default, jPCT-AE does this call automatically, so usually there’s no need to call this method directly.
      Parameters:
      dynamic – if the mesh dynamic?
    • compile

      Mainly needed to ease porting from the desktop version of jPCT. By default, jPCT-AE does this call automatically, so usually there’s no need to call this method directly.
      Parameters:
      dynamic – if the mesh dynamic?
      staticUV – does it use static uv-coordinates
    • shareCompiledData

      Enables a compiled object to share data with another compiled one. This helps to save system or GPU memory, depending on the used mode for compilation.
      The object you would like to share data with must not share data itself with some other, it must not use an octree. Furthermore, both objects have to use the same mesh (not just the same data but the exact same instance), this object must not share data with some other.
      This object will inherit all texture coordinates and vertex alpha values from the source object no matter what may have been assigned to it.
      Parameters:
      withObj – the object to share data with
    • touch

      Touches an object. This has a meaning for dynamically compiled objects and for objects that use lazy transformations. If touched, changes in vertices (and u/v-coordinates if supported) will be retransfered to the graphics card and the transformation matrices of objects using lazy transformations will be recalculated.
    • strip

      移除一些不再需要使用的数据以节省一些内存。Frees some memory by stripping some data that isn’t needed anymore unless you want to modify the object afterwards by using a PolygonManager.
    • forceGeometryIndices

      Forces the object to be compiled to indexed geometry no matter what. Default is false and jPCT will try to figure out, what is best for an object. If this is true, it will override this detection. Compiling to indexed geometry is more expensive, the result might be smaller in memory and depending on the device, it will be rendered faster or slower…
      This has to be set before calling build() to have an effect.
      Parameters:
      force – should we?
    • setAnimationSequence

      Sets the keyframe animation sequence that should be used for this object. It is required that the object is already initialized with a frame (usually the first) of the animation including texture-coords, -data and mesh information. The keyframes of an animation only contain the raw mesh data (like getMesh() would return it). Everything else needs to be taken from the object itself.
      Parameters:
      anim – the animation sequence
      See Also:
      AnimationgetMesh()
    • clearAnimation

      清除对象的动画,Its mesh data will be that of the last frame interpolation.
    • getAnimationSequence

      Returns the animation sequence.
      Returns:
      the Animation sequence or null if none has been defined
    • animate

      Calculates a new mesh for this object based on the keyframes of its animation sub-sequence and “index”. index is a value between 0 and 1 where 0 is the first keyframe and 1 the last (of the sub-sequence). If seq is zero, the whole animation will be treated as a sub-sequence.
      Parameters:
      index – the “time-index” into the sub-sequence of the animation
      seq – the number of the sub.sequence (sub-sequence start at 1, 0 stands for the animation as a whole)
    • animate

      Calculates a new mesh for this object based on the keyframes of its animation sequence and “index”. index is a value between 0 and 1 where 0 is the first keyframe and 1 the last. Because no sub-sequence is indicated, the complete animation will be used.
      Parameters:
      index – the “time-index” into the animation
    • setCollisionMode

      设置碰撞检测模式. Setting mode to COLLISION_CHECK_NONE (which is default) means, that the object can’t be partner in a collision with other objects. Setting it to COLLISION_CHECK_OTHERS means that other objects may collide with this object and setting it to COLLISION_CHECK_SELF means, that the object itself may collide with other objects. The modes may be combined by using the or-operator | .
      Parameters:
      mode – The desired mode (COLLISION_CHECK_NONE, COLLISION_CHECK_OTHERS, COLLISION_CHECK_SELF or combinations)
      See Also:
      COLLISION_CHECK_NONECOLLISION_CHECK_OTHERSCOLLISION_CHECK_SELF
    • setCollisionOptimization

      Sets an optimization for collision detection to be used/not used. This optimization may cause problems on dynamically updated geometry from an animation or an IVertexController. Therefor, it’s disabled by default. Couldn’t hurt to try it anyway…:-)
      This optimization affects collisions WITH this object, not OF this object.
      Parameters:
      optimized – should the collision detection be optimized or not
      See Also:
      COLLISION_DETECTION_OPTIMIZEDCOLLISION_DETECTION_NOT_OPTIMIZED
    • setVisibility

      设置3D对象是否可见。
      Parameters:
      mode – visible or not
      See Also:
      OBJ_VISIBLEOBJ_INVISIBLE
    • calcBoundingBox

      Calculates an AABB (Axis Aligned Bounding Box) for this object in object-space. The box will then be transformed together with the object so that it becomes an OBB (oriented bounding box) when the object will be transformed. Normally, there is no need to call this method directly, because it will already be called from the build() method. Exceptions could be the use of objects meshes for animation and similar tasks.
      See Also:
      build()
    • build

      Initializes some basic object properties that are needed for almost all further processing. build() has to be called if the object is “ready to render” (loaded, Textures assigned, placed, rendering modes set, animations and vertex controllers assigned).
      See Also:
      World.buildAllObjects()
    • build

      Initializes some basic object properties that are needed for almost all further processing. build() has to be called if the object is “ready to render” (loaded, Textures assigned, placed, rendering modes set, animations and vertex controllers assigned).
      This method is a special purpose method that has to be used if the UV-coordinates are supposed to be modified.
      See Also:
      build()
    • disableVertexSharing

      Disables the automatic vertex sharing that jPCT does for triangles added by addTriangle. This can be useful if single polygons of the object are supposed to change their positions independantly from the others (by using an IVertexController for example). It will hurt performance though.
    • hasChild

      测试某个对象是不是此对象的子对象。
    • hasParent

      测试此对象是不是某对象的子对象。
    • addChild

      将一个对象添加为此对象的子对象。子对象将继承此对象的旋转、缩放等变换操作。
       注意:需要使用world.addObject()才能将子对象渲染在界面中
    • removeChild

      删除一个子对象。
    • removeParent

      Removes an object from the parent-collection of this. The object itself won’t be removed.
      Parameters:
      obj – the Object3D to remove
    • addParent

      Defines an object as a parent of this. this will inherit all transformations from its parent and no other attributes. Defining child and parent object is basically the same. Child object of A will internally be stored by assigning A as their parent. It’s a matter of taste which kind of logic one may use. Therefor, both are supported but the parent-logic is closer to the implementation…then again: Who cares?
      Parameters:
      obj – the object that should become a parent of this.
    • getParents

      返回此对象的所有parents对象。
    • getID

      Returns the object’s ID. The ID is automatically generated and set in the constructor. This ID is used to manage the object once it has been added to an instance of World. In some cases, it could be necessary to reset the ID.
      Returns:
      the internal ID of the object
      See Also:
      resetNextID()World.addObject(com.threed.jpct.Object3D)
    • getName

      返回对象的名字,对象的默认的名字为”object” + 内部ID,可以使用setName对此属性进行赋值。
    • setName

      Sets the name of the object to a name other than the default one. The name may be used to identify the object in the world’s collection of objects. 名字必须唯一。
    • wasVisible

      返回对象在最后一帧的时候是否可见。 This can be useful for some rough optimizations on the application level, but beware of assuming too much frame coherence. The method doesn’t take overdraw into account.
      Returns:
      true if it was visible
    • setCulling

      允许或者禁止此对象的背面渲染? Backface culling is applied to all objects by default. Anyway, some objects may require it to be disabled because of the way they are build. Disabling backface culling for any object usually double the amount of rendered polygons for this object.
    • getCulling

      返回当前的背面渲染是允许还是禁止的。
    • setShadingMode

      jPCT always uses gouraud shading and that can’t be disabled. Anyway, with this method it’s possible to enable a kind of faked flat shading. It will look like flat shading, but it isn’t any faster than gouraud. It may even be slower, because triangle strips and some other optimizations jPCT can apply are disabled when using faked flat shading.
      Parameters:
      mode – the shading mode
      See Also:
      SHADING_GOURAUDSHADING_FAKED_FLAT
    • setLighting

      Sets the lighting mode. Default is, that all kinds of light jPCT knows of will influence the final lighting of the object.
      Parameters:
      mode – the lighting mode
      See Also:
      LIGHTING_ALL_ENABLEDLIGHTING_NO_LIGHTS
    • getLighting

      Gets the lighting mode.
      See Also:
      LIGHTING_ALL_ENABLEDLIGHTING_NO_LIGHTS
    • setMaxLights

      Sets the maximum number of lights that should have an influence on this object. This value affects compiled objects only. Default and global max. value is 8.
      Parameters:
      lightCount – a value between 0 and 8
    • getMaxLights

      Returns the maximum number of lights that should have an influence on this object. Default is 8.
      Returns:
      the number of lights
    • setSpecularLighting

      Enables/Disables specular lighting for the object. The specular lighting pass is applied in addition to ambient and diffuse lighting. Specular lighting may cause objects to look more reflective and realistic. It requires some extra processing but usually it’s just a matter of taste if it will be used on a particular object or not. Specular lighting is disabled by default.
      Parameters:
      mode – the specular mode
      See Also:
      SPECULAR_ENABLEDSPECULAR_DISABLED
    • getSpecularLighting

      Returns the state of specular lighting.
      Returns:
      the specular mode
      See Also:
      SPECULAR_ENABLEDSPECULAR_DISABLED
    • setTransparency

      Sets the object to be transparent using the given level of transparency. In addition to the global transparency of the whole object, every pixel with a color of #000000 will be completely transparent (if you don’t supply an alpha channel with the texture). Note: The current implementation doesn’t use #000000 but #0f0f0f due to accuracy issues with JPEG-compression.
      Parameters:
      trans – the tranparency level. 0 is the highest possible transparency, a value below 0 will disable tranparency for this object
    • setShader

      Sets a shader other than the default shader set. This is only valid when using OpenGL ES 2.0.
      Parameters:
      shader – the shader
    • getShader

      Returns the shader, if another one than the default shader is set. This is only valid when using OpenGL ES 2.0.
      Returns:
      the shader or null if none is set
    • calcTangentVectors

      Tangent vectors are needed for some calculation in shaders. If you are using shaders (i.e. OpenGL ES 2.0) and your shader needs these vectors and jPCT-AE wasn’t able to detect this (by searching for “attribute vec4 tangent” in the vertex shader, you might want to trigger this calculation manually. By default, the calculation happens automatically during build() if the need has been detected.
    • clearShader

      Removes a shader and reverts to the default shader set. This is only valid when using OpenGL ES 2.0.
    • getTransparency

      Returns the current tranparency setting.
      Returns:
      int the transparency level
    • isTransparent

      Returns if the object is transparent of not.
      Returns:
      is it?
    • setTransparencyMode

      Sets the transparency (blending) mode.
      Parameters:
      mode – the mode
      See Also:
      TRANSPARENCY_MODE_DEFAULTTRANSPARENCY_MODE_ADD
    • getTransparencyMode

      Returns the current transparency mode.
      Returns:
      int the mode
      See Also:
      TRANSPARENCY_MODE_DEFAULTTRANSPARENCY_MODE_ADD
    • hasVertexAlpha

      Returns true, if this object uses vertex alpha values. False, if it doesn’t, which is default.
      Returns:
      does it?
    • setAlphaWrites

      Enabled/Disables alpha writes by this object into the framebuffer. This applies to transparent object on transparent framebuffers only. Default is true.
      Parameters:
      alphaWrites – do alpha writes or not
    • isAlphaWrites

      Should alpha writes be used?
      Returns:
      should it?
    • setAdditionalColor

      设置了一下,没见到什么效果。Sets the additional color for this object. This color will be added to the regular color of each vertex (given by ambient, diffuse and specular lighting). This can be used to highlight particular objects on purpose. The limitation to the range of the AWT’s Color doesn’t matter here, because adding a color brighter than (255,255,255) (jPCT supports this overbright lighting) can be useful for lightsources but not for setting a color value that isn’t processed any further. It simply doesn’t get whiter than white…:-)
      Parameters:
      col – the color
    • setAdditionalColor

      设置了一下,没见到什么效果。Sets the additional color for this object. This color will be added to the regular color of each vertex (given by ambient, diffuse and specular lighting). This can be used to highlight particular objects on purpose.
      Parameters:
      red – the red component (0..255)
      green – the green component (0..255)
      blue – the blue component (0..255)
    • getAdditionalColor

      Returns the additional color.
      Returns:
      the color
    • clearAdditionalColor

      Removes additional color information form the object. Calling this method is equal to call setAdditionalColor(Color.black).
    • clearObject

      Clears the object by removing all vertex/mesh information from it. This also affects objects that have been cloned from this object, because they will lose their mesh-data too. Every other property of the object stays intact.
      See Also:
      cloneObject()decoupleMesh()
    • decoupleMesh

      Decouples the current mesh from the object. This may be useful to assign another mesh to the object without affecting cloned objects (from this object). Without the use of cloned objects, the results of clearObject() and decoupleMesh() are the same (= an empty object).
      See Also:
      cloneObject()clearObject()
    • setBillboarding

      允许或者禁止此对象的公告板模式。告示板对象将忽略自身的旋转(子对象可以旋转)矩阵并且一直面向camera。
    • isEnvmapped

      返回3D对象是否使用的环境映射(environment mapping)
      Returns:
      used…or not…
      See Also:
      ENVMAP_ENABLEDENVMAP_DISABLED
    • setEnvmapped

      设置3d对象是否使用环境映射(environment mapping). 如果允许,设置给3d对象的纹理图(texturemap)将使用球形环境映射,默认为false.
    • 环境映射是一种用来模拟光滑表面对周围环境的反射的技术,常见的如镜子、光亮漆面的金属等等。
      这种技术的实现主要通过将一张带有周围环境的贴图附在所需要表现的多边形表面来实现的。在实时3D游戏画面渲染中经常使用的有两种环境映射。
      球形环境映射是模拟在球体表面产生环境映射的技术,通过对普通贴图的UV坐标进行调整计算来产生在球体表面应产生的扭曲。
      UV的计算利用球体表面的法线来计算。
    •  
      Parameters:
      mode – the environment mapping mode
      See Also:
      ENVMAP_ENABLEDENVMAP_DISABLED
    • setFixedPointMode

      If set to true, some operations will be using fixed point instead of floating point. This is less accurate and may cause problems with large coordinates, but is usually faster. Default is true.
      Parameters:
      useFixedPoint – use it?
    • rotateX

      围绕x轴旋转对象的旋转矩阵,旋转效果将在下次渲染时生效。
      Parameters:
      w – 旋转角度,弧度值,逆时针为正,顺时针为负。一周的弧度数为2πr/r=2π,360°角=2π弧度,因此,1弧度约为57.3°,即57°17’44.806”
    • rotateY

      围绕y轴旋转对象的旋转矩阵,旋转效果将在下次渲染时生效。
      Parameters:
      w – 旋转角度,弧度值,逆时针为正,顺时针为负。一周的弧度数为2πr/r=2π,360°角=2π弧度,因此,1弧度约为57.3°,即57°17’44.806”
    • rotateZ

      围绕z轴旋转对象的旋转矩阵,旋转效果将在下次渲染时生效。
      Parameters:
      w – 旋转角度,弧度值,逆时针为正,顺时针为负。一周的弧度数为2πr/r=2π,360°角=2π弧度,因此,1弧度约为57.3°,即57°17’44.806”
    • rotateAxis

      围绕任意一个轴进行旋转。 The method is more powerful than the normal rotate-around-an-axis methods, but also a bit slower. The resulting matrix will be orthonormalized to ensure numerical stability.
      Parameters:
      axis – a direction-vector pointing into the axis direction with the object’s rotation pivot as position vector
      angle – the angle of the rotation
    • translateMesh

      Translates the raw mesh data using the translation and the origin matrix of this object. This translation is applied directly onto the mesh and therefor it’s permanent. This could be useful for defining animation keyframes via object meshes or for altering objects in objectspace. Translating a mesh forces the object’s bounding box to be recalculated afterwards (automatically done).
    • translate

      移动对象。
      Parameters:
      trans – the translation vector
    • translate

      Translates (“moves”) the object in worldspace by modifying the translation matrix. The translation will be applied the next time the object is rendered.
      Parameters:
      x – the number of units the object should be translated parallel to the x axis
      y – the number of units the object should be translated parallel to the y axis
      z – the number of units the object should be translated parallel to the z axis
    • align

      Aligns this object with a Camera using the camera’s backbuffer matrix. This means that the object (i.e. its positive z-axis) will face into the same direction as the camera does. Calling this method modifies the object’s rotation matrix, but not its translation or origin matrix, i.e. the object is facing into the camera’s direction but it’s not automatically placed at the camera’s position. This has to be done “by hand” if required. Keep in mind that the rotation pivot of this object influences the outcome too.
      Parameters:
      camera – the Camera the Object3D should be aligned with
    • align

      Aligns this object with another Object3D. This basically means that both objects will face into the same direction after calling this method. Keep in mind that the rotation pivot influences the outcome too. This method works on the object’s own rotation matrix only. It doesn’t take transformations of parent objects into account.
      Parameters:
      object – the object this object should be aligned with
    • setOrientation

      Sets the orientation of this object by giving a direction and an up-vector.
      Parameters:
      dir – the direction
      up – the up-vector
    • enableLazyTransformations

      Enables “lazy transformations”. When lazy transformations are being used, the world-transformation matrix (as well as its inverse if needed) is calculated only once and used from there on until lazy transformations are being disabled again. This helps to improve performance for static objects and it can be VERY helpful to speed-up collision detection with such objects. It may also be used on none-static objects if they aren’t moving/rotating for some time (for example: if a lot of objects should be checked for collision, it could be helpful to enable lazy transformations before doing this and disabling it right after the tests).
      Enabling this again after it already has been clears the stored values, i.e. you can use this to update the calculated matrix inbetween without disabling the mode entirely.
      See Also:
      disableLazyTransformations()
    • disableLazyTransformations

      Disables “lazy transformations”. This is the default setting for every new object.
      See Also:
      enableLazyTransformations()
    • scale

      Scales the object. A scale-value greater than 1 will result in the object to get bigger, while a value lower than 1 causes the object to shrink (when transformed…the Mesh won’t be touched). Remember that the scales (as well as rotations and translations) are cumulative.
      Please note that setting or clearing the rotation matrix will reset this value. You are supposed to reset the scaling to 1 before doing so.
      Parameters:
      scale – the new scale
      See Also:
      setScale(float)
    • setScale

      Sets an absolute value for the object’s scaling. Useful, if the cumulative scaling of scale() isn’t what one wants.
      Please note that setting or clearing the rotation matrix will reset this value. You are supposed to reset the scaling to 1 before doing so.
      Parameters:
      absScale – the new (absolute) scale
      See Also:
      scale(float)
    • getScale

      Returns the cumulated scale value for this object.
      Returns:
      the current scaling
    • getTranslation

      返回对象的位置移动信息(从origin位置到当前位置)。
      Returns:
      the translation
    • getTranslation

      Returns the translation of the object. The returned SimpleVector is the same one as the one given as parameter. This is useful to save the creation of an additional object. If null is given, a new one will be created.
      Parameters:
      trns – the SimpleVector to fill and return
      Returns:
      the translation
    • getOrigin

      返回origin对应的坐标。
      Returns:
      the oring
    • getXAxis

      Returns the x-axis of the object. This is an imaginary axis useful for movement und rotations relative to the object. This is based on the rotation matrix only. It doesn’t take any parent objects into account.
      Returns:
      the x-axis
    • getYAxis

      Returns the y-axis of the object. This is an imaginary axis useful for movement und rotations relative to the object. This is based on the rotation matrix only. It doesn’t take any parent objects into account.
      Returns:
      the y-axis
    • getZAxis

      Returns the z-axis of the object. This is an imaginary axis useful for movement und rotations relative to the object. This is based on the rotation matrix only. It doesn’t take any parent objects into account.
      Returns:
      the z-axis
    • getXAxis

      Returns the x-axis of the object. This is an imaginary axis useful for movement und rotations relative to the object. This is based on the rotation matrix only. It doesn’t take any parent objects into account. This method fills the given SimpleVector in addition to returning it.
      Parameters:
      toFill – the vector to fill
      Returns:
      the x-axis
    • getYAxis

      Returns the y-axis of the object. This is an imaginary axis useful for movement und rotations relative to the object. This is based on the rotation matrix only. It doesn’t take any parent objects into account. This method fills the given SimpleVector in addition to returning it.
      Parameters:
      toFill – the vector to fill
      Returns:
      the y-axis
    • getZAxis

      Returns the z-axis of the object. This is an imaginary axis useful for movement und rotations relative to the object. This is based on the rotation matrix only. It doesn’t take any parent objects into account. This method fills the given SimpleVector in addition to returning it.
      Parameters:
      toFill – the vector to fill
      Returns:
      the z-axis
    • getRotationMatrix

      Returns the object’s current rotation matrix.
      Returns:
      the rotation matrix of this object
    • getTranslationMatrix

      Returns the object’s current translation matrix.
      Returns:
      the translation matrix of this object
    • getOriginMatrix

      Returns the object’s origin-translation matrix. This matrix is a kind of static translation matrix for the object used to initially place the object into worldspace. Without using child/parent-objects, there is no difference between using the translation and the origin matrix, but only the former will be applied to child objects of this object. It is advised to use the origin matrix to place the object into worldspace once and to execute all further translations by using the translation matrix (or by using the translate()-method which already does this for you).
      Returns:
      the origin-translation matrix of this object
      See Also:
      translate(float,float,float)setOrigin(com.threed.jpct.SimpleVector)
    • getLightCount

      Returns the number of lights that have an influence on this object. This is only valid during rendering, i.e. only when called from within an IRenderHook.
      Returns:
      the number of used lights
    • setRotationMatrix

      Sets the rotation matrix for the object. Usually, this is not required as long as the rotateX/Y/Z() methods are satisfying your needs. If you do this, make sure to reset the scale by calling setScale(1f) if you previously modified it.
      Parameters:
      mat – the new rotation matrix
      See Also:
      rotateX(float)rotateY(float)rotateZ(float)
    • clearRotation

      Resets the current rotation to the initial value, i.e. no rotation at all. This will also reset the scale.
    • clearTranslation

      Resets the current translation to the initial value, i.e. no translation at all.
    • setTextureMatrix

      Sets a matrix that is applied to transform the texture in stage 0. If no transformation is needed, null should be set instead of an empty matrix.
      Note: This doesn’t work on all phones. On a Samsung Galaxy with Android 1.5 for example, changing the texture matrix has no effect!?
      Parameters:
      mat – the matrix
    • getTextureMatrix

      Returns the current texture matrix of null if none is set.
      Returns:
      the texture matrix
    • rotateMesh

      Rotates the raw mesh data using the rotation matrix specified for this object. This rotation is applied directly onto the mesh and therefor it’s permanent. This could be useful for defining animation keyframes via object meshes or for altering objects in objectspace. Rotating a mesh forces the object’s bounding box to be recalculated afterwards (automatically done). The rotation matrix of the object won’t be reset by this method.
    • setTranslationMatrix

      Sets the translation matrix for the object. Usually, this is not required as long as the translate() method is satisfying your needs.
    • setMesh

      Sets an object’s mesh to another one. Shouldn’t be required in normal applications.
      Parameters:
      mesh – the new mesh of the object
      See Also:
      getMesh()calcBoundingBox()
    • getMesh

      Returns the current mesh of the object. This is useful for using an object’s mesh data as keyframes for an animation. The returned mesh can also be added to another object by using setMesh(). If you do so, both objects will share the same instance of mesh. That isn’t a problem as long as you don’t want to modify the mesh of one object without changing the other’s. In this case, you should better use a copy of the mesh obtained from Mesh.cloneMesh().
      Returns:
      the object’s mesh
      See Also:
      AnimationMesh.cloneMesh(boolean)setMesh(com.threed.jpct.Mesh)
    • getPolygonManager

      Returns the PolygonManager for this object. A PolygonManager can be used to access an object’s polygons. While you can obtain a PolygonManager from a stripped object, you can’t safely modify the object.
      Returns:
      the manager
      See Also:
      strip()
    • setBoundingBox

      Sets a new AABB for the object. Usually, this shouldn’t be required as it is automatically done by the build()-method.
      Parameters:
      minx – the lowest x-value of the AABB
      maxx – the highest x-value of the AABB
      miny – the lowest y-value of the AABB
      maxy – the highest y-value of the AABB
      minz – the lowest z-value of the AABB
      maxz – the highest z-value of the AABB
      See Also:
      build()calcBoundingBox()
    • cloneObject

      Clones the current object. A cloned object A’ of an object A is a copy of A at the point when the cloning takes places. This means that A’ inherits all rotations, translations and rendering properties from A. However, A’ and A are sharing the same mesh data (to save memory). This will cause A’ to inherit all keyframe animations from A and vice versa. Keep this in mind when cloning animated objects. Cloning an object is a costly operation that should only be done when needed. If multiple copies of an object are required during runtime, it may be helpful to create them at startup. This method also copies properties like lazy transformation settings and similar, so take care to adjust afterwards on the cloned object if needed. Cloning doesn’t clone collision modes. Please note that this doesn’t work on stripped objects until you set their meshes to locked.
      Returns:
      the cloned object
    • getWorldTransformation

      Returns the transformation matrix used to transform the object from objectspace into worldspace. Could be useful for debugging purposes, but usually this information shouldn’t be needed.
      Returns:
      the transformation matrix
    • addCollisionListener

      给对象添加一个碰撞监听器。当对象有碰撞发生时,会通过监听器进行回调通知。
    • removeCollisionListener

      移除碰撞监听器。
    • disableCollisionListeners

      禁止对象的所有碰撞监听器。
    • enableCollisionListeners

      启用对象的碰撞监听器。
    • getCollisionListeners

      返回对象碰撞监听器的迭代器。
    • setRenderHook

      Sets a new hook into the rendering pipeline. This is only valid for compiled objects. Any other object will never access this hook. The hook won’t be serialized if the Object3D is.
      Parameters:
      hook – the hook into the rendering pipeline
      See Also:
      IRenderHook
    • getRenderHook

      Returns the render hook or null, if none has been set.
      Returns:
      the hook or null
    • addSpecificLight

      将一个Light对象添加到对象的light列表中。 如果对象的light列表是空的,当渲染对象时世界中的所有对象都会影响到3d对象,如果light列表中有light对象,则只有这些light对象用来给3d对象打光。light对象必须添加到对象所在的world对象中。
    • removeSpecificLight

      在对象的light列表中移除一个light对象。
    • clearSpecificLights

      清空对象的light列表。
    • checkForCollision

      Checks if the current object collides with something when moving into a particular direction. This is just a check, so no translations are being performed. A collision can only be detected with objects that are set to COLLISION_CHECK_OTHERS. This method uses a ray-polygon collision detection.
      Parameters:
      dirVec – the direction vector (a unit vector)
      step – the length of the casted ray (a collision will only be detected of it takes place within this range)
      Returns:
      the ID of the Object3D if there is a collision, otherwise NO_OBJECT
      See Also:
      setCenter(com.threed.jpct.SimpleVector)setCollisionMode(int)getID()NO_OBJECT
    • checkForCollisionSpherical

      Checks if the current object collides with something when moving into a particular direction. This is just a check, so no translations are being performed. A collision can only be detected with objects that are set to COLLISION_CHECK_OTHERS. This method uses a sphere-polygon collision detection.
      Parameters:
      translation – the translation the object should perform
      radius – the radius of the sphere (a collision will only be detected of it takes place within this radius)
      Returns:
      a SimpleVector containing a corrected translation vector. This vector represents the translation that should be applied to the object to avoid a collision. If no collision takes place, the translation won’t be corrected though (i.e. no collision means returned SimpleVector.equals(translation))
      See Also:
      setCenter(com.threed.jpct.SimpleVector)setCollisionMode(int)
    • checkForCollisionEllipsoid

      Checks if the current object collides with something when moving into a particular direction. This is just a check, so no translations are being performed. A collision can only be detected with objects that are set to COLLISION_CHECK_OTHERS. This method uses a (swept)ellipsoid-polygon collision detection.
      Parameters:
      translation – the translation the object should perform
      ellipsoid – the radius of the epplisoid in x,y and z direction
      recursionDepth – the max. recursion depth of the collision detection. A higher value will improve the accuracy of the collision detection but reduce performance. Reasonable values lie between 1 and 5.
      Returns:
      a SimpleVector containing a corrected translation vector. This vector represents the translation that should be applied to the object to avoid a collision. If no collision takes place, the translation won’t be corrected though (i.e. no collision means returned SimpleVector.equals(translation))
      See Also:
      setCenter(com.threed.jpct.SimpleVector)setCollisionMode(int)
    • setEllipsoidMode

      When doing ellipsoid collision detection with this object, the ellipsoid can be transformed according to the objects’s transformation and in the source’s object space or it remains static in the target’s object space (i.e. “axis aligned”).
      The later is faster, but not suitable for all kinds of ellipsoids.
      Parameters:
      mode – int the mode
      See Also:
      ELLIPSOID_ALIGNEDELLIPSOID_TRANSFORMED
    • getEllipsoidMode

      Returns the current ellipsoid mode.
      See Also:
      ELLIPSOID_ALIGNEDELLIPSOID_TRANSFORMED
    • wasTargetOfLastCollision

      True, if this object was a target of the last collision detection that took place (regardless of what kind it was). Otherwise false. “A target” in this context means, that something has collided with this object, i.e. if one checks object A for collision with other objects and it collides with an object B, B is the target and A is the source. A collision is not automatically detected. One has to use one of the various ways jPCT offers for collision detection to detect it.
      Returns:
      was this object a target of the last detected collision?
      See Also:
      resetCollisionStatus()
    • resetCollisionStatus

      Sets the indicator that the object was a target of the last collision detection to false, i.e. the object won’t be recognized any longer as part of the collision. This is done automatically the next time a collision detection method is being called.
      See Also:
      wasTargetOfLastCollision()
    • calcMinDistance

      Returns the minimal distance to some polygon of the object from a particular position vector looking into a specific direction.
      Parameters:
      org – a SimpleVector containing the position vector
      dr – a SimpleVector containing the direction vector
      Returns:
      the minimal distance to some polygon (= how far can one move into this direction until something will be hit). If there is no such polygon, COLLISION_NONE will be returned.
      See Also:
      COLLISION_NONE
    • calcMinDistance

      Returns the minimal distance to some polygon of the object from a particular position vector looking into a specific direction. This version is a special purpose version of calcMinDistance() which only takes polygons into consideration that have at least one vertex that is closer than ignoreIfLarger units to the position vector. Can be useful to optimize calculations in situations where it is known how far away the polygon with the minimal distance can be at max.
      Parameters:
      org – a SimpleVector containing the position vector
      dr – a SimpleVector containing the direction vector
      ignoreIfLarger – only polygons within this range will be taken into account
      Returns:
      the minimal distance to some polygon (= how far can one move into this direction until something will be hit). If there is no such polygon, COLLISION_NONE will be returned.
      See Also:
      COLLISION_NONE
    • setCenter

      Sets the center of the object (in object-space). This “center” doesn’t has to be the real center of the object but it’s the point in objectspace which will be used for collision detection. This means that if one tests if the object may move A units into (x,y,z)-direction, actually it’s tested if this point (transformed into world-space) may move A units into (x,y,z)-direction. Calling build() resets this value to a calculated center, so this method should be called after calling build().
    • 调用calcTextureWrapSpherical函数会, 这个设置中心点会丢失?
    •  
      Parameters:
      center – the center
      See Also:
      build()
    • getCenter

      返回对象的中心坐标(相对于对象本身的)
    • getTransformedCenter

      返回对象在世界的中心坐标。
    • getTransformedCenter

      返回对象在世界的中心点坐标。The returned SimpleVector is the same one as the one given as parameter. This is useful to save the creation of an additional object. If null is given, a new one will be created.
    • setRotationPivot

      设置对象的rotation pivot(旋转支点). 未测试出此旋转支点影响哪个旋转函数,对于rotateX, rotateY, rotateZ好像没什么影响。The rotation pivot is the point in objectspace around which the object will be rotated using its rotation matrix. Calling build() resets this value to a calculated rotation pivot, so this method should be called after calling build().
    • 调用calcTextureWrapSpherical函数后,这个函数设置的RotationPivot会丢失?
    •  
      Parameters:
      pivot – the rotation pivot
    • getRotationPivot

      返回对象rotation pivot(旋转支点)的信息
    • calcCenter

      使用mesh data尝试计算3D对象的中心点。这是一个非常不精确的方法,但是在大部分对象上工作的很好,在其他上面也可能失败。这个方法设置对象的center(中心)和rotation pivot(旋转支点)。对象的build()方法会调用这个方法。
      See Also:
      setCenter(com.threed.jpct.SimpleVector)setRotationPivot(com.threed.jpct.SimpleVector)build()
    • setOcTree

      Assigns an octree to the object. An octree may help to increase performance for some kind of objects (like large landscapes). It’s not possible to combine portals and octrees (at least not in jPCT), so setting the octree will be ignored if portal rendering is enabled. In every other case, the object will be rendered using the octree as soon as it’s assigned to it.
      Please keep in mind that calculating triangle strips has to be done before building/assigning the tree, because it will destroy the tree.
      Parameters:
      ocTree – the octree that subdivides this object
    • getOcTree

      返回赋给这个3D对象的OcTree(八叉树)对象,如果没有返回null.
    • setOrigin

      Sets the origin of the object. The origin is a position in worldspace at which the object will be placed before performing any other translations. The difference between the origin and a normal translation is, that the normal translation affects the child objects (if any) while the translation to the origin doesn’t.
      Parameters:
      origin – the origin
      See Also:
      translate(float, float, float)
    • invert

      按字面意思是反转3D对象,但是代码测试了一下,没看到反转的效果。Physically “inverts” the object, which means that the backface culling works the other way round. This could be used for example on a cube that is usually viewed from outside to make it possible to view it from the inside (and still use backface culling on it). Inverting an object is a costly operation.
    • invertCulling

      Inverts culling order if set to true. This affects culling only, not the mesh itself (unlike invert()).
      Parameters:
      inv – invert the culling?
    • cullingIsInverted

      Returns true, if inverted culling is used on this object. False otherwise.
      Returns:
      is it?
    • calcNormals

      Calculates the object’s vertex normals by calculating the face normals of the adjacent polygons of each vertex and averaging them. The normals are required for lighting and mapping, so they need to be calculated for every object. Usually, this is already done by calling the object’s build() method. (Respective by the loader for MD2-files).
      See Also:
      build()
    • calcTextureWrap

      给3D对象贴上纹理(具体在什么位置什么角度贴不太确定,适合单色的或者贴图不需要对准位置的情况)。这样贴上去的纹理可能在每个对象看着不太正确,但是这是给没有纹理的3d对象贴图的最快的方式了。这是一种最基本的静态环境映射的贴图。
      See Also:
      calcTextureWrapSpherical()
    • calcTextureWrapSpherical

      以一种球形的方式给3d对象贴图。通常情况下,这个方法比calcTextureWrap函数产生一个更好的贴图效果,当然这个取决于3d对象。This method is well suited to assign texture-coordinates to objects that were generated using the Primitives class.这个方法将会重新计算3d对象的中心点,所以所有对3d对象中心或者rotation-pivot的修改在这个方法调用后都将会丢失。
      See Also:
      calcTextureWrap()Primitives
    • setTexture

      通过Texture名称设置纹理,需要提前通过TextureManager.getInstance().addTexture添加到TextureManager中。
      Parameters:
      texname – 通过TextureManager.addTexture()方法添加的纹理名称
    • setTexture

      Sets the texture for the object via an instance of TextureInfo.
      Texture coordinates for all layers are taken from the coordinates defined for the base layer of the Object3D, i.e. u/v coordinates given to this TextureInfo will be ignored.
      Parameters:
      tInf – the TextureInfo
      See Also:
      TextureInfo
    • shareTextureData

      In addition to sharing the actual mesh data, you can also make objects share the same texturing information (the actual textures, not the uv-coordinates). If you do this, changing the texture on one object will change it on all sharing objects too.
      This helps to save some memory, especially on objects that use multiple textures.
      Parameters:
      source – the source of the texturing information
    • rayIntersectsAABB

      Checks if a given ray intersects with the axis aligned bounding box (in object-space) of this object. This can be useful to speed up some calculations. jPCT is using this method for faster collision detection.
      If the object doesn’t have a bounding box for whatever reason, RAY_MISSES_BOX will be returned.
      Parameters:
      org – the position vector of the ray
      dr – the direction vector of the ray
      isNormalized – indicates, that dr is already normalized. So the method can spare another normalization.
      Returns:
      the distance between the starting point of the ray and the nearest plane of the box. If the ray doesn’t intersect the box, RAY_MISSES_BOX will be returned
      See Also:
      RAY_MISSES_BOX
    • rayIntersectsAABB

      Checks if a given ray intersects with the axis aligned bounding box (in object-space) of this object. This can be useful to speed up some calculations. jPCT is using this method for faster collision detection.
      If the object doesn’t have a bounding box for whatever reason, RAY_MISSES_BOX will be returned.
      Parameters:
      org – the position vector of the ray
      dr – the direction vector of the ray
      Returns:
      the distance between the starting point of the ray and the nearest plane of the box. If the ray doesn’t intersect the box, RAY_MISSES_BOX will be returned
      See Also:
      RAY_MISSES_BOX
    • ellipsoidIntersectsAABB

      Checks if a given ellipsoid intersects the axis aligned bounding box (in object-space) of this object. This can be useful to speed up some calculations. jPCT is using this method for faster collision detection. “Intersection” means everything from touching it to being completely covered by it in this case.
      If the object doesn’t have a bounding box for whatever reason, false will be returned.
      Parameters:
      org – the position vector of the ellipsoid (the ellipsoid’s center)
      ellipsoid – the radius of the ellipsoid in x,y and z-direction as a SimpleVector
      Returns:
      true if there is an intersection, otherwise false
    • ellipsoidIntersectsAABB

    • sphereIntersectsAABB

      Checks if a given sphere intersects the axis aligned bounding box (in object-space) of this object. This can be useful to speed up some calculations. jPCT is using this method for faster collision detection. “Intersection” means everything from touching it to being completely covered by it in this case.
      If the object doesn’t have a bounding box for whatever reason, false will be returned.
      Parameters:
      org – the position vector of the sphere (the sphere’s center)
      radius – the radius of the sphere
      Returns:
      true if there is an intersection, otherwise false
    • addTriangle

      在3d对象上添加一个三角形。 Using the method, the texture of the object won’t be set and the sector will be set to undefined. Texture coordinates won’t be set (= set to (0,0) for all vertices).可以使用带TextureInfo参数的addTriangle函数来给他赋Texture。 三角形顶点需要逆时针定义因为because jPCT backface culls them by default. 你也可以顺时针定义顶点然后调用invert()函数来反转顺序。
      Parameters:
      vert1 – the first vertex
      vert2 – the second vertex
      vert3 – the third vertex
      Returns:
      添加的三角形的数量
    • addTriangle

      Adds a triangle to the object. Using the method, the texture of the object won’t be set and the sector will be set to undefined. The vertices have to be defined counter-clockwise because jPCT backface culls them by default. One may also add them clockwise and call invert() afterwards to “invert” the order.
      Parameters:
      vert1 – the first vertex
      u – the u component of the texture position at the first vertex
      v – the v component of the texture position at the first vertex
      vert2 – the second vertex
      u2 – the u component of the texture position at the second vertex
      v2 – the v component of the texture position at the second vertex
      vert3 – the third vertex
      u3 – the u component of the texture position at the third vertex
      v3 – the v component of the texture position at the third vertex
      Returns:
      the number of the added triangle
      See Also:
      invert()
    • addTriangle

      Adds a triangle to the object. Using the method, the sector will be set to undefined. The vertices have to be defined counter-clockwise because jPCT backface culls them by default. One may also add them clockwise and call invert() afterwards to “invert” the order.
      Parameters:
      vert1 – the first vertex
      u – the u component of the texture position at the first vertex
      v – the v component of the texture position at the first vertex
      vert2 – the second vertex
      u2 – the u component of the texture position at the second vertex
      v2 – the v component of the texture position at the second vertex
      vert3 – the third vertex
      u3 – the u component of the texture position at the third vertex
      v3 – the v component of the texture position at the third vertex
      textureID – the ID of the texture as returned by TextureManager.getTextureID()
      Returns:
      the number of the added triangle
      See Also:
      TextureManager.getTextureID(java.lang.String)invert()
    • addTriangle

      Adds a triangle to the object. The vertices have to be defined counter-clockwise because jPCT backface culls them by default. One may also add them clockwise and call invert() afterwards to “invert” the order.
      Parameters:
      vert1 – the first vertex
      u – the u component of the texture position at the first vertex
      v – the v component of the texture position at the first vertex
      vert2 – the second vertex
      u2 – the u component of the texture position at the second vertex
      v2 – the v component of the texture position at the second vertex
      vert3 – the third vertex
      u3 – the u component of the texture position at the third vertex
      v3 – the v component of the texture position at the third vertex
      textureID – the ID of the texture as returned by TextureManager.getTextureID()
      Returns:
      the number of the added triangle
      See Also:
      TextureManager.getTextureID(java.lang.String)invert()
    • addTriangle

      Adds a triangle to the object. The vertices have to be defined counter-clockwise because jPCT backface culls them by default. One may also add them clockwise and call invert() afterwards to “invert” the order.
      This method takes a TextureInfo instead of the discrete u/v-coordinates and the textureID.
      Parameters:
      vert1 – the first vertex
      vert2 – the second vertex
      vert3 – the third vertex
      tInf – the TextureInfo
      Returns:
      the number of the added triangle
      See Also:
      TextureManager.getTextureID(java.lang.String)TextureInfoinvert()
    • getInverseWorldTransformation

    • getInverseWorldTransformation

 Posted by on 2021-12-22

Android实现TextView搜索关键字高亮显示

 分类:Android, Java 阅读 (1,137)  Android实现TextView搜索关键字高亮显示已关闭评论
3月 222021
 

效果图如下:

关键字搜索不区分大小写,TextView换成EditText也同样适用

Activity部局代码如下:

Activity代码如下:

 

安卓设置系统语言的方法

 分类:Android, Java 阅读 (2,365)  安卓设置系统语言的方法已关闭评论
11月 262020
 

本文基于Android8.1系统,应用需要为系统应用

实现方法参考此链接:https://blog.csdn.net/weijuantang/article/details/41379027

通过反射实现设置语言功能的函数:

调用方法:

 

 Posted by on 2020-11-26

Android获取和设置时区

 分类:Android, Java 阅读 (4,004)  Android获取和设置时区已关闭评论
11月 262020
 

本文适用于Android8.0及以上系统,应用必须为系统应用

获取时区列表(>=Android8.0)

设置时区:

获取时区:

 

 Posted by on 2020-11-26