-
Notifications
You must be signed in to change notification settings - Fork 1
Piston equivalents
For example, the Expression2 snippets below are equivalent and are also presented
how they are used in E2 Chip
here with a top piston configuration of
55.306
degrees as a number and vector internals. The value of Shaft:cnvPistonMark()
as VBER
is actually the same angle but represented as a local vector relative to the crankshaft,
which is later converted to one relative to the Base
entity for efficiency ( Otherwise all the top
piston vectors must be converted to the Shaft
or all to be converted to world-space rather than
local ). The value Base
is the base prop of your engine that your crankshaft is constrained to via
an axis and Shaft
is the entity based on which the bearing is calculated. Whatever bearing data type
you prefer to represent the bearing either number or vector it is due to a way of preference. The piston
configuration properties are described below with a tutorial on how to create a piston, define bearing
and use it as needed. The execution speed scaled 1..10
:
Initialization:
Shaft:setPistonSign(1, 55.306)
Usage:
BER = Chip:bearing(GPS)
Shaft:getPiston(1, BER)
Shaft:getPiston(2, BER)
Shaft:getPiston(N, BER)
Initialization:
Shaft:setPistonWave(1, 55.306)
Usage:
BER = Chip:bearing(GPS)
Shaft:getPiston(1, BER)
Shaft:getPiston(2, BER)
Shaft:getPiston(N, BER)
Initialization:
Shaft:setPistonRamp(1, 55.306)
Usage:
BER = Chip:bearing(GPS)
Shaft:getPiston(1, BER)
Shaft:getPiston(2, BER)
Shaft:getPiston(N, BER)
Initialization:
Shaft = entity()
setPistonBase(Shaft:isConstrainedTo("axis"))
setPistonAxis(0.601048110939, -0.79921284295, 0)
setPistonMark(0,0,1)
Shaft:setPistonSignX(1, vec(0,1,0))
Usage:
BER = Shaft:cnvPistonMark()
Shaft:getPiston(1, BER)
Shaft:getPiston(2, BER)
Shaft:getPiston(N, BER)
Initialization:
Shaft = entity()
setPistonBase(Shaft:isConstrainedTo("axis"))
setPistonAxis(0.601048110939, -0.79921284295, 0)
setPistonMark(0,0,1)
Shaft:setPistonSignX(1, vec(0,1,0))
Usage:
BER = Shaft:cnvPistonMark()
Shaft:getPiston(1, BER)
Shaft:getPiston(2, BER)
Shaft:getPiston(N, BER)
Attention! Do not modify these wiki pages manually! They are automatically generated and will be overwritten in the next update! I constantly develop this addon, so it will be better to just tell me if something is wrong via the issue system.