Class: Disp3D::NodeSphere

Inherits:
NodeLeaf show all
Defined in:
lib/node/node_sphere.rb

Instance Attribute Summary

Attributes inherited from Node

#instance_id, #name, #parents

Instance Method Summary collapse

Methods inherited from NodeLeaf

#draw, #update_for_display

Methods inherited from Node

#ancestors, #post_draw, #pre_draw

Constructor Details

#initialize(geom = nil, name = nil) ⇒ NodeSphere

Returns a new instance of NodeSphere.



8
9
10
11
12
13
14
# File 'lib/node/node_sphere.rb', line 8

def initialize(geom=nil, name=nil)
  super
  @radius = 1.0
  @center = Vector3.new()
  @slices = 10
  @stacks = 10
end

Instance Method Details

#boxObject



16
17
18
19
# File 'lib/node/node_sphere.rb', line 16

def box
  rtn_box = Box.new(Vector3.new(-@radius,-@radius,-@radius)+@center, Vector3.new(@radius,@radius,@radius)+@center)
  return box_transform(rtn_box)
end