capsuleBuilder.d.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { VertexData } from "../mesh.vertexData";
  2. import { Vector3 } from "../../Maths/math.vector";
  3. import { Mesh } from "../mesh";
  4. import type { Nullable } from "../../types";
  5. import type { Scene } from "../../scene";
  6. /**
  7. * Scripts based off of https://github.com/maximeq/three-js-capsule-geometry/blob/master/src/CapsuleBufferGeometry.js
  8. * @param options the constructors options used to shape the mesh.
  9. * @returns the capsule VertexData
  10. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/capsule
  11. */
  12. export declare function CreateCapsuleVertexData(options?: ICreateCapsuleOptions): VertexData;
  13. /**
  14. * The options Interface for creating a Capsule Mesh
  15. */
  16. export interface ICreateCapsuleOptions {
  17. /** The Orientation of the capsule. Default : Vector3.Up() */
  18. orientation?: Vector3;
  19. /** Number of sub segments on the tube section of the capsule running parallel to orientation. */
  20. subdivisions?: number;
  21. /** Number of cylindrical segments on the capsule. */
  22. tessellation?: number;
  23. /** Height or Length of the capsule. */
  24. height?: number;
  25. /** Radius of the capsule. */
  26. radius?: number;
  27. /** Number of sub segments on the cap sections of the capsule running parallel to orientation. */
  28. capSubdivisions?: number;
  29. /** Overwrite for the top radius. */
  30. radiusTop?: number;
  31. /** Overwrite for the bottom radius. */
  32. radiusBottom?: number;
  33. /** Overwrite for the top capSubdivisions. */
  34. topCapSubdivisions?: number;
  35. /** Overwrite for the bottom capSubdivisions. */
  36. bottomCapSubdivisions?: number;
  37. /** Internal geometry is supposed to change once created. */
  38. updatable?: boolean;
  39. }
  40. /**
  41. * Creates a capsule or a pill mesh
  42. * @param name defines the name of the mesh
  43. * @param options The constructors options.
  44. * @param scene The scene the mesh is scoped to.
  45. * @returns Capsule Mesh
  46. */
  47. export declare function CreateCapsule(name: string, options?: ICreateCapsuleOptions, scene?: Nullable<Scene>): Mesh;
  48. /**
  49. * Class containing static functions to help procedurally build meshes
  50. * @deprecated please use CreateCapsule directly
  51. */
  52. export declare const CapsuleBuilder: {
  53. CreateCapsule: typeof CreateCapsule;
  54. };