mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Allow vertical axis particle rotation constraint
Use tables for adding particles, deprecate former way. separate particles(pawner) definition, add default values, work with no arguments
This commit is contained in:
parent
a4c5f10ecf
commit
2b1eff7725
10 changed files with 266 additions and 93 deletions
|
@ -1462,30 +1462,20 @@ minetest.ban_player(name) -> ban a player
|
|||
minetest.unban_player_or_ip(name) -> unban player or IP address
|
||||
|
||||
Particles:
|
||||
minetest.add_particle(pos, velocity, acceleration, expirationtime,
|
||||
minetest.add_particle(particle definition)
|
||||
^ Deprecated: minetest.add_particle(pos, velocity, acceleration, expirationtime,
|
||||
size, collisiondetection, texture, playername)
|
||||
^ Spawn particle at pos with velocity and acceleration
|
||||
^ Disappears after expirationtime seconds
|
||||
^ collisiondetection: if true collides with physical objects
|
||||
^ Uses texture (string)
|
||||
^ Playername is optional, if specified spawns particle only on the player's client
|
||||
|
||||
minetest.add_particlespawner(amount, time,
|
||||
minetest.add_particlespawner(particlespawner definition)
|
||||
^ Add a particlespawner, an object that spawns an amount of particles over time seconds
|
||||
^ Returns an id
|
||||
^ Deprecated: minetest.add_particlespawner(amount, time,
|
||||
minpos, maxpos,
|
||||
minvel, maxvel,
|
||||
minacc, maxacc,
|
||||
minexptime, maxexptime,
|
||||
minsize, maxsize,
|
||||
collisiondetection, texture, playername)
|
||||
^ Add a particlespawner, an object that spawns an amount of particles over time seconds
|
||||
^ The particle's properties are random values in between the boundings:
|
||||
^ minpos/maxpos, minvel/maxvel (velocity), minacc/maxacc (acceleration),
|
||||
^ minsize/maxsize, minexptime/maxexptime (expirationtime)
|
||||
^ collisiondetection: if true uses collisiondetection
|
||||
^ Uses texture (string)
|
||||
^ Playername is optional, if specified spawns particle only on the player's client
|
||||
^ If time is 0 has infinite lifespan and spawns the amount on a per-second base
|
||||
^ Returns and id
|
||||
|
||||
minetest.delete_particlespawner(id, player)
|
||||
^ Delete ParticleSpawner with id (return value from add_particlespawner)
|
||||
|
@ -2443,3 +2433,50 @@ HUD Definition (hud_add, hud_get)
|
|||
offset = {x=0, y=0},
|
||||
^ See "HUD Element Types"
|
||||
}
|
||||
|
||||
Particle definition (add_particle)
|
||||
{
|
||||
pos = {x=0, y=0, z=0},
|
||||
velocity = {x=0, y=0, z=0},
|
||||
acceleration = {x=0, y=0, z=0},
|
||||
^ Spawn particle at pos with velocity and acceleration
|
||||
expirationtime = 1,
|
||||
^ Disappears after expirationtime seconds
|
||||
size = 1,
|
||||
collisiondetection = false,
|
||||
^ collisiondetection: if true collides with physical objects
|
||||
vertical = false,
|
||||
^ vertical: if true faces player using y axis only
|
||||
texture = "image.png",
|
||||
^ Uses texture (string)
|
||||
playername = "singleplayer"
|
||||
^ Playername is optional, if specified spawns particle only on the player's client
|
||||
}
|
||||
|
||||
Particlespawner definition (add_particlespawner)
|
||||
{
|
||||
amount = 1,
|
||||
time = 1,
|
||||
^ If time is 0 has infinite lifespan and spawns the amount on a per-second base
|
||||
minpos = {x=0, y=0, z=0},
|
||||
maxpos = {x=0, y=0, z=0},
|
||||
minvel = {x=0, y=0, z=0},
|
||||
maxvel = {x=0, y=0, z=0},
|
||||
minacc = {x=0, y=0, z=0},
|
||||
maxacc = {x=0, y=0, z=0},
|
||||
minexptime = 1,
|
||||
maxexptime = 1,
|
||||
minsize = 1,
|
||||
maxsize = 1,
|
||||
^ The particle's properties are random values in between the boundings:
|
||||
^ minpos/maxpos, minvel/maxvel (velocity), minacc/maxacc (acceleration),
|
||||
^ minsize/maxsize, minexptime/maxexptime (expirationtime)
|
||||
collisiondetection = false,
|
||||
^ collisiondetection: if true uses collisiondetection
|
||||
vertical = false,
|
||||
^ vertical: if true faces player using y axis only
|
||||
texture = "image.png",
|
||||
^ Uses texture (string)
|
||||
playername = "singleplayer"
|
||||
^ Playername is optional, if specified spawns particle only on the player's client
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue