Files
addr2line
adler
aead
aes
aes_gcm
aes_soft
ahash
aho_corasick
ansi_term
anyhow
approx
arrayref
arrayvec
asn1_der
der
types
asn1_der_derive
async_channel
async_executor
async_global_executor
async_io
async_mutex
async_process
async_std
collections
binary_heap
btree_map
btree_set
hash_map
hash_set
linked_list
vec_deque
fs
canonicalize.rscopy.rscreate_dir.rscreate_dir_all.rsdir_builder.rsdir_entry.rsfile.rsfile_type.rshard_link.rsmetadata.rsmod.rsopen_options.rspermissions.rsread.rsread_dir.rsread_link.rsread_to_string.rsremove_dir.rsremove_dir_all.rsremove_file.rsrename.rsset_permissions.rssymlink_metadata.rswrite.rs
future
io
buf_read
read
seek
write
net
option
os
path
pin
result
rt
stream
double_ended_stream
stream
all.rsany.rschain.rscloned.rscmp.rscopied.rscount.rscycle.rsdelay.rsenumerate.rseq.rsfilter.rsfilter_map.rsfind.rsfind_map.rsflat_map.rsflatten.rsfold.rsfor_each.rsfuse.rsge.rsgt.rsinspect.rslast.rsle.rslt.rsmap.rsmax.rsmax_by.rsmax_by_key.rsmerge.rsmin.rsmin_by.rsmin_by_key.rsmod.rsne.rsnext.rsnth.rspartial_cmp.rspartition.rsposition.rsscan.rsskip.rsskip_while.rsstep_by.rstake.rstake_while.rsthrottle.rstimeout.rstry_fold.rstry_for_each.rsunzip.rszip.rs
string
sync
task
unit
vec
async_task
async_trait
asynchronous_codec
atomic
atomic_waker
atty
backtrace
base58
base64
base_x
bincode
bip39
bitflags
bitvec
array
boxed
field
macros
ptr
slice
vec
blake2
blake2_rfc
simd_opt
blake2b_simd
blake2s_simd
blake3
block_buffer
block_cipher
block_padding
blocking
bs58
bstr
bumpalo
byte_slice_cast
byteorder
bytes
buf
fmt
cache_padded
cfg_if
chacha20
chacha20poly1305
chrono
format
naive
offset
sys
cid
cipher
clap
app
args
completions
concurrent_queue
const_fn
constant_time_eq
cpp_demangle
cpuid_bool
cranelift_bforest
cranelift_codegen
binemit
ir
isa
unwind
x86
legalizer
machinst
regalloc
verifier
abi.rsbitset.rscfg_printer.rsconstant_hash.rscontext.rscursor.rsdata_value.rsdbg.rsdce.rsdivconst_magic_numbers.rsdominator_tree.rsflowgraph.rsfx.rsinst_predicates.rsiterators.rslib.rslicm.rsloop_analysis.rsnan_canonicalization.rspartition_slice.rspostopt.rspredicates.rsprint_errors.rsredundant_reload_remover.rsremove_constant_phis.rsresult.rsscoped_hash_map.rssettings.rssimple_gvn.rssimple_preopt.rsstack_layout.rstiming.rstopo_order.rsunreachable_code.rsvalue_label.rswrite.rs
cranelift_codegen_shared
cranelift_entity
cranelift_frontend
cranelift_native
cranelift_wasm
crc32fast
crossbeam_channel
crossbeam_deque
crossbeam_epoch
crossbeam_utils
crunchy
crypto_mac
ct_logs
cuckoofilter
curve25519_dalek
backend
data_encoding
data_encoding_macro
data_encoding_macro_internal
derive_more
digest
directories
directories_next
dirs_sys
dirs_sys_next
dns_parser
rdata
dyn_clonable
dyn_clonable_impl
dyn_clone
ed25519
ed25519_dalek
either
env_logger
filter
fmt
environmental
erased_serde
errno
event_listener
exit_future
failure
failure_derive
fallible_iterator
fastrand
fdlimit
file_per_thread_logger
finality_grandpa
fixed_hash
flate2
deflate
ffi
gz
zlib
fnv
fork_tree
form_urlencoded
frame_benchmarking
frame_benchmarking_cli
frame_executive
frame_metadata
frame_support
storage
frame_support_procedural
construct_runtime
pallet
expand
parse
storage
frame_support_procedural_tools
frame_support_procedural_tools_derive
frame_system
extensions
frame_system_rpc_runtime_api
fs_swap
funty
futures
futures_channel
futures_core
futures_diagnose
futures_executor
futures_io
futures_lite
futures_macro
futures_rustls
futures_sink
futures_task
futures_timer
futures_util
async_await
compat
future
future
try_future
io
allow_std.rsbuf_reader.rsbuf_writer.rschain.rsclose.rscopy.rscopy_buf.rscursor.rsempty.rsfill_buf.rsflush.rsinto_sink.rslines.rsmod.rsread.rsread_exact.rsread_line.rsread_to_end.rsread_to_string.rsread_until.rsread_vectored.rsrepeat.rsseek.rssink.rssplit.rstake.rswindow.rswrite.rswrite_all.rswrite_vectored.rs
lock
sink
stream
futures_unordered
stream
buffer_unordered.rsbuffered.rscatch_unwind.rschain.rschunks.rscollect.rsconcat.rscycle.rsenumerate.rsfilter.rsfilter_map.rsflatten.rsfold.rsfor_each.rsfor_each_concurrent.rsforward.rsfuse.rsinto_future.rsmap.rsmod.rsnext.rspeek.rsready_chunks.rsscan.rsselect_next_some.rsskip.rsskip_while.rssplit.rstake.rstake_until.rstake_while.rsthen.rsunzip.rszip.rs
try_stream
task
generic_array
getrandom
ghash
gimli
read
write
globset
h2
codec
frame
hpack
proto
handlebars
decorators
helpers
json
hash256_std_hasher
hash_db
hashbrown
heck
hex
hex_fmt
hmac
hmac_drbg
http
http_body
httparse
httpdate
humantime
hyper
body
client
common
proto
server
service
hyper_rustls
idna
if_watch
impl_codec
impl_serde
impl_trait_for_tuples
indexmap
inflector
cases
camelcase
case
classcase
kebabcase
pascalcase
screamingsnakecase
sentencecase
snakecase
tablecase
titlecase
traincase
numbers
string
suffix
instant
integer_sqrt
intervalier
iovec
ip_network
ipnet
itertools
adaptors
combinations.rscombinations_with_replacement.rsconcat_impl.rscons_tuples_impl.rsdiff.rseither_or_both.rsexactly_one_err.rsformat.rsfree.rsgroup_map.rsgroupbylazy.rsimpl_macros.rsintersperse.rskmerge_impl.rslazy_buffer.rslib.rsmerge_join.rsminmax.rsmultipeek_impl.rspad_tail.rspeeking_take_while.rspermutations.rsprocess_results_impl.rsput_back_n_impl.rsrciter_impl.rsrepeatn.rssize_hint.rssources.rstee.rstuple_impl.rsunique_impl.rswith_position.rszip_eq_impl.rszip_longest.rsziptuple.rs
itoa
js_sys
jsonrpc_client_transports
jsonrpc_core
jsonrpc_core_client
jsonrpc_derive
jsonrpc_http_server
jsonrpc_ipc_server
jsonrpc_pubsub
jsonrpc_server_utils
jsonrpc_ws_server
keccak
kv_log_macro
kvdb
kvdb_memorydb
kvdb_rocksdb
lazy_static
lazycell
leb128
libc
unix
libm
math
acos.rsacosf.rsacosh.rsacoshf.rsasin.rsasinf.rsasinh.rsasinhf.rsatan.rsatan2.rsatan2f.rsatanf.rsatanh.rsatanhf.rscbrt.rscbrtf.rsceil.rsceilf.rscopysign.rscopysignf.rscos.rscosf.rscosh.rscoshf.rserf.rserff.rsexp.rsexp10.rsexp10f.rsexp2.rsexp2f.rsexpf.rsexpm1.rsexpm1f.rsexpo2.rsfabs.rsfabsf.rsfdim.rsfdimf.rsfenv.rsfloor.rsfloorf.rsfma.rsfmaf.rsfmax.rsfmaxf.rsfmin.rsfminf.rsfmod.rsfmodf.rsfrexp.rsfrexpf.rshypot.rshypotf.rsilogb.rsilogbf.rsj0.rsj0f.rsj1.rsj1f.rsjn.rsjnf.rsk_cos.rsk_cosf.rsk_expo2.rsk_expo2f.rsk_sin.rsk_sinf.rsk_tan.rsk_tanf.rsldexp.rsldexpf.rslgamma.rslgamma_r.rslgammaf.rslgammaf_r.rslog.rslog10.rslog10f.rslog1p.rslog1pf.rslog2.rslog2f.rslogf.rsmod.rsmodf.rsmodff.rsnextafter.rsnextafterf.rspow.rspowf.rsrem_pio2.rsrem_pio2_large.rsrem_pio2f.rsremainder.rsremainderf.rsremquo.rsremquof.rsround.rsroundf.rsscalbn.rsscalbnf.rssin.rssincos.rssincosf.rssinf.rssinh.rssinhf.rssqrt.rssqrtf.rstan.rstanf.rstanh.rstanhf.rstgamma.rstgammaf.rstrunc.rstruncf.rs
libp2p
libp2p_core
connection
identity
muxing
network
transport
upgrade
libp2p_core_derive
libp2p_deflate
libp2p_dns
libp2p_floodsub
libp2p_gossipsub
peer_score
libp2p_identify
libp2p_kad
kbucket
query
peers
record
libp2p_mdns
libp2p_mplex
libp2p_noise
libp2p_ping
libp2p_plaintext
libp2p_pnet
libp2p_request_response
libp2p_swarm
libp2p_tcp
provider
libp2p_uds
libp2p_wasm_ext
libp2p_websocket
libp2p_yamux
librocksdb_sys
libz_sys
linked_hash_map
linked_hash_set
linregress
lock_api
log
lru
maplit
matchers
matches
matrixmultiply
memchr
memmap2
memoffset
memory_db
memory_units
merlin
minicbor
minicbor_derive
miniz_oxide
mio
deprecated
net
sys
mio_extras
mio_named_pipes
mio_uds
miow
more_asserts
multibase
multihash
multihash_derive
multistream_select
nalgebra
base
alias.rsalias_slice.rsallocator.rsarray_storage.rsblas.rscg.rscomponentwise.rsconstraint.rsconstruction.rsconstruction_slice.rsconversion.rscoordinates.rsdefault_allocator.rsdimension.rsedition.rshelper.rsindexing.rsiter.rsmatrix.rsmatrix_simba.rsmatrix_slice.rsmod.rsnorm.rsops.rsproperties.rsscalar.rsstatistics.rsstorage.rsswizzle.rsunit.rsvec_storage.rs
geometry
abstract_rotation.rsisometry.rsisometry_alias.rsisometry_construction.rsisometry_conversion.rsisometry_ops.rsisometry_simba.rsmod.rsop_macros.rsorthographic.rsperspective.rspoint.rspoint_alias.rspoint_construction.rspoint_conversion.rspoint_coordinates.rspoint_ops.rspoint_simba.rsquaternion.rsquaternion_construction.rsquaternion_conversion.rsquaternion_coordinates.rsquaternion_ops.rsquaternion_simba.rsreflection.rsrotation.rsrotation_alias.rsrotation_construction.rsrotation_conversion.rsrotation_ops.rsrotation_simba.rsrotation_specialization.rssimilarity.rssimilarity_alias.rssimilarity_construction.rssimilarity_conversion.rssimilarity_ops.rssimilarity_simba.rsswizzle.rstransform.rstransform_alias.rstransform_construction.rstransform_conversion.rstransform_ops.rstransform_simba.rstranslation.rstranslation_alias.rstranslation_construction.rstranslation_conversion.rstranslation_coordinates.rstranslation_ops.rstranslation_simba.rsunit_complex.rsunit_complex_construction.rsunit_complex_conversion.rsunit_complex_ops.rsunit_complex_simba.rs
linalg
names
nb_connect
net2
node_template
node_template_runtime
nohash_hasher
num_bigint
num_complex
num_cpus
num_integer
num_rational
num_traits
object
read
coff
elf
macho
pe
write
once_cell
opaque_debug
openssl_probe
owning_ref
pallet_aura
pallet_authorship
pallet_balances
pallet_collection
pallet_exchange
pallet_grandpa
pallet_graph
pallet_nft
pallet_nftdao
pallet_randomness_collective_flip
pallet_session
pallet_sub
pallet_sudo
pallet_timestamp
pallet_transaction_payment
pallet_transaction_payment_rpc
pallet_transaction_payment_rpc_runtime_api
parity_db
parity_multiaddr
parity_scale_codec
parity_scale_codec_derive
parity_send_wrapper
parity_tokio_ipc
parity_util_mem
parity_util_mem_derive
parity_wasm
builder
elements
parity_ws
parking
parking_lot
parking_lot_core
paste
paste_impl
pbkdf2
pdqselect
percent_encoding
pest
iterators
unicode
pest_derive
pest_generator
pest_meta
pin_project
pin_project_lite
pin_utils
polling
poly1305
polyval
ppv_lite86
primitive_types
proc_macro2
proc_macro_crate
proc_macro_error
proc_macro_error_attr
proc_macro_hack
proc_macro_nested
prometheus
prost
prost_derive
psm
pwasm_utils
quick_error
quicksink
quote
radium
rand
distributions
rngs
seq
rand_chacha
rand_core
rand_distr
raw_cpuid
rawpointer
rayon
collections
compile_fail
iter
chain.rschunks.rscloned.rscopied.rsempty.rsenumerate.rsextend.rsfilter.rsfilter_map.rsfind.rsflat_map.rsflat_map_iter.rsflatten.rsflatten_iter.rsfold.rsfor_each.rsfrom_par_iter.rsinspect.rsinterleave.rsinterleave_shortest.rsintersperse.rslen.rsmap.rsmap_with.rsmod.rsmultizip.rsnoop.rsonce.rspanic_fuse.rspar_bridge.rspositions.rsproduct.rsreduce.rsrepeat.rsrev.rsskip.rssplitter.rsstep_by.rssum.rstake.rstry_fold.rstry_reduce.rstry_reduce_with.rsunzip.rsupdate.rswhile_some.rszip.rszip_eq.rs
slice
rayon_core
compile_fail
join
scope
sleep
spawn
thread_pool
ref_cast
ref_cast_impl
regalloc
analysis_control_flow.rsanalysis_data_flow.rsanalysis_main.rsanalysis_reftypes.rsavl_tree.rsbt_coalescing_analysis.rsbt_commitment_map.rsbt_main.rsbt_spillslot_allocator.rsbt_vlr_priority_queue.rschecker.rsdata_structures.rsinst_stream.rslib.rspretty_print.rsreg_maps.rssnapshot.rssparse_set.rsunion_find.rs
regex
regex_automata
regex_syntax
ast
hir
unicode_tables
region
remove_dir_all
retain_mut
ring
aead
gcm
arithmetic
digest
ec
curve25519
suite_b
io
rsa
rocksdb
rpassword
rustc_demangle
rustc_hash
rustc_hex
rustls
client
manual
msgs
server
rustls_native_certs
rw_stream_sink
ryu
safe_mix
salsa20
sc_basic_authorship
sc_block_builder
sc_chain_spec
sc_chain_spec_derive
sc_cli
commands
params
sc_client_api
sc_client_db
sc_consensus
sc_consensus_aura
sc_consensus_babe
sc_consensus_epochs
sc_consensus_slots
sc_consensus_uncles
sc_executor
sc_executor_common
sc_executor_wasmi
sc_executor_wasmtime
instance_wrapper
sc_finality_grandpa
communication
sc_informant
sc_keystore
sc_light
sc_network
light_client_requests
protocol
generic_proto
sync
service
sc_network_gossip
sc_offchain
sc_peerset
sc_proposer_metrics
sc_rpc
author
chain
offchain
state
system
sc_rpc_api
author
chain
child_state
offchain
state
system
sc_rpc_server
sc_service
chain_ops
client
task_manager
sc_state_db
sc_telemetry
sc_tracing
sc_tracing_proc_macro
sc_transaction_graph
sc_transaction_pool
schnorrkel
scoped_tls
scopeguard
scroll
scroll_derive
sct
secp256k1
secrecy
serde
de
private
ser
serde_derive
serde_json
sha1
sha2
sha3
sharded_slab
signal_hook
signal_hook_registry
signature
simba
scalar
simd
slab
smallvec
snow
socket2
soketto
sp_allocator
sp_api
sp_api_proc_macro
sp_application_crypto
sp_arithmetic
sp_authorship
sp_block_builder
sp_blockchain
sp_chain_spec
sp_consensus
import_queue
sp_consensus_aura
sp_consensus_babe
sp_consensus_slots
sp_consensus_vrf
sp_core
offchain
sp_database
sp_debug_derive
sp_externalities
sp_finality_grandpa
sp_inherents
sp_io
sp_keyring
sp_keystore
sp_offchain
sp_panic_handler
sp_rpc
sp_runtime
generic
offchain
sp_runtime_interface
sp_runtime_interface_proc_macro
pass_by
runtime_interface
sp_serializer
sp_session
sp_staking
sp_state_machine
changes_trie
overlayed_changes
sp_std
sp_storage
sp_tasks
sp_timestamp
sp_tracing
sp_transaction_pool
sp_trie
sp_utils
sp_version
sp_wasm_interface
spin
stable_deref_trait
static_assertions
statrs
distribution
bernoulli.rsbeta.rsbinomial.rscategorical.rscauchy.rschi.rschi_squared.rsdirichlet.rsdiscrete_uniform.rserlang.rsexponential.rsfisher_snedecor.rsgamma.rsgeometric.rshypergeometric.rsinternal.rsinverse_gamma.rslog_normal.rsmod.rsmultinomial.rsnormal.rspareto.rspoisson.rsstudents_t.rstriangular.rsuniform.rsweibull.rsziggurat.rsziggurat_tables.rs
function
statistics
stream_cipher
strsim
structopt
structopt_derive
strum
strum_macros
helpers
macros
substrate_bip39
substrate_fixed
substrate_frame_rpc_system
substrate_prometheus_endpoint
subtle
syn
attr.rsawait.rsbigint.rsbuffer.rscustom_keyword.rscustom_punctuation.rsdata.rsderive.rsdiscouraged.rserror.rsexport.rsexpr.rsext.rsfile.rsgenerics.rsgroup.rsident.rsitem.rslib.rslifetime.rslit.rslookahead.rsmac.rsmacros.rsop.rsparse.rsparse_macro_input.rsparse_quote.rspat.rspath.rsprint.rspunctuated.rsreserved.rssealed.rsspan.rsspanned.rsstmt.rsthread.rstoken.rstt.rsty.rsverbatim.rswhitespace.rs
synstructure
take_mut
tap
target_lexicon
tempfile
termcolor
textwrap
thiserror
thiserror_impl
thread_local
threadpool
time
tiny_keccak
tinyvec
tinyvec_macros
tokio
future
io
driver
util
async_buf_read_ext.rsasync_read_ext.rsasync_seek_ext.rsasync_write_ext.rsbuf_reader.rsbuf_stream.rsbuf_writer.rschain.rscopy.rsempty.rsflush.rslines.rsmem.rsmod.rsread.rsread_buf.rsread_exact.rsread_int.rsread_line.rsread_to_end.rsread_to_string.rsread_until.rsreader_stream.rsrepeat.rsshutdown.rssink.rssplit.rsstream_reader.rstake.rswrite.rswrite_all.rswrite_buf.rswrite_int.rs
loom
std
macros
net
park
runtime
blocking
task
thread_pool
signal
stream
sync
task
time
util
tokio_codec
tokio_executor
tokio_io
_tokio_codec
codec
io
tokio_named_pipes
tokio_reactor
tokio_rustls
tokio_service
tokio_sync
tokio_uds
tokio_util
codec
toml
tower_service
tracing
tracing_attributes
tracing_core
tracing_futures
tracing_log
tracing_serde
tracing_subscriber
field
filter
fmt
registry
trie_db
trie_root
try_lock
twox_hash
typenum
ucd_trie
uint
unicase
unicode_bidi
unicode_normalization
unicode_segmentation
unicode_width
unicode_xid
universal_hash
unsigned_varint
untrusted
url
vec_arena
vec_map
void
waker_fn
want
wasm_bindgen
wasm_bindgen_backend
wasm_bindgen_futures
wasm_bindgen_macro
wasm_bindgen_macro_support
wasm_bindgen_shared
wasm_timer
wasmi
wasmi_validation
wasmparser
readers
alias_section.rscode_section.rsdata_section.rselement_section.rsevent_section.rsexport_section.rsfunction_section.rsglobal_section.rsimport_section.rsinit_expr.rsinstance_section.rslinking_section.rsmemory_section.rsmod.rsmodule_code_section.rsmodule_section.rsname_section.rsoperators.rsproducers_section.rsreloc_section.rssection_reader.rstable_section.rstype_section.rs
validator
wasmtime
wasmtime_cache
wasmtime_cranelift
wasmtime_debug
transform
wasmtime_environ
wasmtime_jit
unwind
wasmtime_obj
wasmtime_profiling
wasmtime_runtime
wast
ast
resolve
wat
webpki
webpki_roots
winapi
wyz
x25519_dalek
yamux
zeroize
zeroize_derive
zstd
block
stream
zstd_safe
zstd_sys
>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
use num::{One, Zero}; use simba::scalar::{RealField, SubsetOf, SupersetOf}; use simba::simd::PrimitiveSimdValue; use crate::base::allocator::Allocator; use crate::base::dimension::{DimName, DimNameAdd, DimNameSum, U1}; use crate::base::{DefaultAllocator, MatrixN, Scalar, VectorN}; use crate::geometry::{ AbstractRotation, Isometry, Similarity, SuperTCategoryOf, TAffine, Transform, Translation, }; /* * This file provides the following conversions: * ============================================= * * Translation -> Translation * Translation -> Isometry * Translation -> Similarity * Translation -> Transform * Translation -> Matrix (homogeneous) */ impl<N1, N2, D: DimName> SubsetOf<Translation<N2, D>> for Translation<N1, D> where N1: Scalar, N2: Scalar + SupersetOf<N1>, DefaultAllocator: Allocator<N1, D> + Allocator<N2, D>, { #[inline] fn to_superset(&self) -> Translation<N2, D> { Translation::from(self.vector.to_superset()) } #[inline] fn is_in_subset(rot: &Translation<N2, D>) -> bool { crate::is_convertible::<_, VectorN<N1, D>>(&rot.vector) } #[inline] fn from_superset_unchecked(rot: &Translation<N2, D>) -> Self { Translation { vector: rot.vector.to_subset_unchecked(), } } } impl<N1, N2, D: DimName, R> SubsetOf<Isometry<N2, D, R>> for Translation<N1, D> where N1: RealField, N2: RealField + SupersetOf<N1>, R: AbstractRotation<N2, D>, DefaultAllocator: Allocator<N1, D> + Allocator<N2, D>, { #[inline] fn to_superset(&self) -> Isometry<N2, D, R> { Isometry::from_parts(self.to_superset(), R::identity()) } #[inline] fn is_in_subset(iso: &Isometry<N2, D, R>) -> bool { iso.rotation == R::identity() } #[inline] fn from_superset_unchecked(iso: &Isometry<N2, D, R>) -> Self { Self::from_superset_unchecked(&iso.translation) } } impl<N1, N2, D: DimName, R> SubsetOf<Similarity<N2, D, R>> for Translation<N1, D> where N1: RealField, N2: RealField + SupersetOf<N1>, R: AbstractRotation<N2, D>, DefaultAllocator: Allocator<N1, D> + Allocator<N2, D>, { #[inline] fn to_superset(&self) -> Similarity<N2, D, R> { Similarity::from_parts(self.to_superset(), R::identity(), N2::one()) } #[inline] fn is_in_subset(sim: &Similarity<N2, D, R>) -> bool { sim.isometry.rotation == R::identity() && sim.scaling() == N2::one() } #[inline] fn from_superset_unchecked(sim: &Similarity<N2, D, R>) -> Self { Self::from_superset_unchecked(&sim.isometry.translation) } } impl<N1, N2, D, C> SubsetOf<Transform<N2, D, C>> for Translation<N1, D> where N1: RealField, N2: RealField + SupersetOf<N1>, C: SuperTCategoryOf<TAffine>, D: DimNameAdd<U1>, DefaultAllocator: Allocator<N1, D> + Allocator<N2, D> + Allocator<N1, DimNameSum<D, U1>, DimNameSum<D, U1>> + Allocator<N2, DimNameSum<D, U1>, DimNameSum<D, U1>>, { #[inline] fn to_superset(&self) -> Transform<N2, D, C> { Transform::from_matrix_unchecked(self.to_homogeneous().to_superset()) } #[inline] fn is_in_subset(t: &Transform<N2, D, C>) -> bool { <Self as SubsetOf<_>>::is_in_subset(t.matrix()) } #[inline] fn from_superset_unchecked(t: &Transform<N2, D, C>) -> Self { Self::from_superset_unchecked(t.matrix()) } } impl<N1, N2, D> SubsetOf<MatrixN<N2, DimNameSum<D, U1>>> for Translation<N1, D> where N1: RealField, N2: RealField + SupersetOf<N1>, D: DimNameAdd<U1>, DefaultAllocator: Allocator<N1, D> + Allocator<N2, D> + Allocator<N1, DimNameSum<D, U1>, DimNameSum<D, U1>> + Allocator<N2, DimNameSum<D, U1>, DimNameSum<D, U1>>, { #[inline] fn to_superset(&self) -> MatrixN<N2, DimNameSum<D, U1>> { self.to_homogeneous().to_superset() } #[inline] fn is_in_subset(m: &MatrixN<N2, DimNameSum<D, U1>>) -> bool { let id = m.fixed_slice::<DimNameSum<D, U1>, D>(0, 0); // Scalar types agree. m.iter().all(|e| SupersetOf::<N1>::is_in_subset(e)) && // The block part does nothing. id.is_identity(N2::zero()) && // The normalization factor is one. m[(D::dim(), D::dim())] == N2::one() } #[inline] fn from_superset_unchecked(m: &MatrixN<N2, DimNameSum<D, U1>>) -> Self { let t = m.fixed_slice::<D, U1>(0, D::dim()); Self { vector: crate::convert_unchecked(t.into_owned()), } } } impl<N: Scalar + Zero + One, D: DimName> From<Translation<N, D>> for MatrixN<N, DimNameSum<D, U1>> where D: DimNameAdd<U1>, DefaultAllocator: Allocator<N, D> + Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>, { #[inline] fn from(t: Translation<N, D>) -> Self { t.to_homogeneous() } } impl<N: Scalar, D: DimName> From<VectorN<N, D>> for Translation<N, D> where DefaultAllocator: Allocator<N, D>, { #[inline] fn from(vector: VectorN<N, D>) -> Self { Translation { vector } } } impl<N: Scalar + PrimitiveSimdValue, D: DimName> From<[Translation<N::Element, D>; 2]> for Translation<N, D> where N: From<[<N as simba::simd::SimdValue>::Element; 2]>, N::Element: Scalar, DefaultAllocator: Allocator<N, D> + Allocator<N::Element, D>, { #[inline] fn from(arr: [Translation<N::Element, D>; 2]) -> Self { Self::from(VectorN::from([ arr[0].vector.clone(), arr[1].vector.clone(), ])) } } impl<N: Scalar + PrimitiveSimdValue, D: DimName> From<[Translation<N::Element, D>; 4]> for Translation<N, D> where N: From<[<N as simba::simd::SimdValue>::Element; 4]>, N::Element: Scalar, DefaultAllocator: Allocator<N, D> + Allocator<N::Element, D>, { #[inline] fn from(arr: [Translation<N::Element, D>; 4]) -> Self { Self::from(VectorN::from([ arr[0].vector.clone(), arr[1].vector.clone(), arr[2].vector.clone(), arr[3].vector.clone(), ])) } } impl<N: Scalar + PrimitiveSimdValue, D: DimName> From<[Translation<N::Element, D>; 8]> for Translation<N, D> where N: From<[<N as simba::simd::SimdValue>::Element; 8]>, N::Element: Scalar, DefaultAllocator: Allocator<N, D> + Allocator<N::Element, D>, { #[inline] fn from(arr: [Translation<N::Element, D>; 8]) -> Self { Self::from(VectorN::from([ arr[0].vector.clone(), arr[1].vector.clone(), arr[2].vector.clone(), arr[3].vector.clone(), arr[4].vector.clone(), arr[5].vector.clone(), arr[6].vector.clone(), arr[7].vector.clone(), ])) } } impl<N: Scalar + PrimitiveSimdValue, D: DimName> From<[Translation<N::Element, D>; 16]> for Translation<N, D> where N: From<[<N as simba::simd::SimdValue>::Element; 16]>, N::Element: Scalar, DefaultAllocator: Allocator<N, D> + Allocator<N::Element, D>, { #[inline] fn from(arr: [Translation<N::Element, D>; 16]) -> Self { Self::from(VectorN::from([ arr[0].vector.clone(), arr[1].vector.clone(), arr[2].vector.clone(), arr[3].vector.clone(), arr[4].vector.clone(), arr[5].vector.clone(), arr[6].vector.clone(), arr[7].vector.clone(), arr[8].vector.clone(), arr[9].vector.clone(), arr[10].vector.clone(), arr[11].vector.clone(), arr[12].vector.clone(), arr[13].vector.clone(), arr[14].vector.clone(), arr[15].vector.clone(), ])) } }