Bump engine submodule and fix signed integers normalisation.
This commit is contained in:
		
							
								
								
									
										2
									
								
								engine
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								engine
									
									
									
									
									
								
							 Submodule engine updated: 59d13684be...f463db316f
									
								
							@ -219,9 +219,12 @@ class ObjArchive(Archive):
 | 
				
			|||||||
        assert name not in self.vertices_db.keys()
 | 
					        assert name not in self.vertices_db.keys()
 | 
				
			||||||
        #TODO: move to math
 | 
					        #TODO: move to math
 | 
				
			||||||
        def pack_10(_x):
 | 
					        def pack_10(_x):
 | 
				
			||||||
            return round(_x * (512.0 if _x < 0.0 else 511.0)) & 1023
 | 
					            assert _x >= -1.0 and _x <= 1.0
 | 
				
			||||||
 | 
					            return round(_x * 511.0) & 1023
 | 
				
			||||||
 | 
					            # return ((round(_x * 1023.0) - 1) // 2) & 1023
 | 
				
			||||||
        def pack_u10(_x):
 | 
					        def pack_u10(_x):
 | 
				
			||||||
            return round(_x * 1023.0) & 1023
 | 
					            assert _x >= 0.0 and _x <= 1.0
 | 
				
			||||||
 | 
					            return round(_x * 1023.0)
 | 
				
			||||||
        def pack_vertex(_px, _py, _pz, _nx, _ny, _nz, _s, _t, _tl):
 | 
					        def pack_vertex(_px, _py, _pz, _nx, _ny, _nz, _s, _t, _tl):
 | 
				
			||||||
            n = (pack_10(_nz) << 20) | (pack_10(_ny) << 10) | pack_10(_nx)
 | 
					            n = (pack_10(_nz) << 20) | (pack_10(_ny) << 10) | pack_10(_nx)
 | 
				
			||||||
            t = ((_tl & 1023) << 20) | (pack_u10(_t) << 10) | pack_u10(_s)
 | 
					            t = ((_tl & 1023) << 20) | (pack_u10(_t) << 10) | pack_u10(_s)
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user