Class: Three::BoxGeometry

Inherits:
BufferGeometry show all
Defined in:
lib/three/geometries/box_geometry.rb

Instance Attribute Summary collapse

Attributes inherited from BufferGeometry

#attributes, #bounding_box, #bounding_sphere, #draw_range, #groups, #id, #index, #name, #type, #user_data, #uuid

Instance Method Summary collapse

Methods inherited from BufferGeometry

#add_group, allocate_id, #clear_groups, #compute_bounding_box, #compute_bounding_sphere, #delete_attribute, #dispose, #get_attribute, #get_index, #has_attribute?, #set_attribute, #set_draw_range, #set_index, #to_h

Methods included from Dirty

#add_dirty_dependent, #dirty?, #dirty_dependents, #dirty_field?, #dirty_fields, #mark_clean!, #mark_dirty!, #remove_dirty_dependent

Methods inherited from EventDispatcher

#add_event_listener, #dispatch_event, #has_event_listener?, #remove_event_listener

Constructor Details

#initialize(width = 1, height = 1, depth = 1, width_segments: 1, height_segments: 1, depth_segments: 1) ⇒ BoxGeometry

Returns a new instance of BoxGeometry.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/three/geometries/box_geometry.rb', line 10

def initialize(width = 1, height = 1, depth = 1, width_segments: 1, height_segments: 1, depth_segments: 1)
  super()
  @type = "BoxGeometry"
  @parameters = {
    width: width,
    height: height,
    depth: depth,
    width_segments: width_segments,
    height_segments: height_segments,
    depth_segments: depth_segments
  }

  build(width, height, depth, width_segments.floor, height_segments.floor, depth_segments.floor)
end

Instance Attribute Details

#parametersObject

Returns the value of attribute parameters.



8
9
10
# File 'lib/three/geometries/box_geometry.rb', line 8

def parameters
  @parameters
end