TextureVo.java 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package min3d.vos;
  2. import java.util.ArrayList;
  3. import javax.microedition.khronos.opengles.GL10;
  4. /**
  5. * Contains the properties of a texture which can be assigned to an object.
  6. * An object can be assigned multiple TextureVo's by adding them to
  7. * the Object3d's TextureList (usually up to just 2 w/ current Android hardware).
  8. *
  9. * The "textureEnvs" ArrayList defines what texture environment commands
  10. * will be sent to OpenGL for the texture. Typically, this needs to hold
  11. * just one TextureEnvVo, but can hold an arbitrary number, for more
  12. * complex 'layering' operations.
  13. *
  14. * TODO: Allow for adding glTexEnvf commands (float instead of int)
  15. *
  16. * TODO: Ability to assign arbitrary UV lists per-TextureVo? (Non-trivial...)
  17. */
  18. public class TextureVo
  19. {
  20. /**
  21. * The texureId in the TextureManager that corresponds to an uploaded Bitmap
  22. */
  23. public String textureId;
  24. /**
  25. * Determines if U and V ("S" and "T" in OpenGL parlance) repeat, or are 'clamped'
  26. * (Defaults to true, matching OpenGL's default setting)
  27. */
  28. public boolean repeatU = true;
  29. public boolean repeatV = true;
  30. /**
  31. * The U/V offsets for the texture (rem, normal range of U and V are 0 to 1)
  32. */
  33. public float offsetU = 0;
  34. public float offsetV = 0;
  35. /**
  36. * A list of TexEnvVo's that define how texture is composited in the output_mkv.
  37. * Normally contains just one element.
  38. */
  39. public ArrayList<TexEnvxVo> textureEnvs;
  40. //
  41. public TextureVo(String $textureId, ArrayList<TexEnvxVo> $textureEnvVo)
  42. {
  43. textureId = $textureId;
  44. textureEnvs = $textureEnvVo;
  45. }
  46. public TextureVo(String $textureId)
  47. {
  48. textureId = $textureId;
  49. textureEnvs = new ArrayList<TexEnvxVo>();
  50. textureEnvs.add( new TexEnvxVo());
  51. }
  52. }